class Shoulda::Matchers::Doublespeak::StubImplementation
@private
Attributes
implementation[R]
Public Class Methods
create()
click to toggle source
# File lib/shoulda/matchers/doublespeak/stub_implementation.rb, line 8 def self.create new end
new()
click to toggle source
# File lib/shoulda/matchers/doublespeak/stub_implementation.rb, line 12 def initialize @implementation = proc { nil } end
Public Instance Methods
call(call)
click to toggle source
# File lib/shoulda/matchers/doublespeak/stub_implementation.rb, line 24 def call(call) call.double.record_call(call) implementation.call(call) end
returns(value = nil, &block)
click to toggle source
# File lib/shoulda/matchers/doublespeak/stub_implementation.rb, line 16 def returns(value = nil, &block) if block @implementation = block else @implementation = proc { value } end end