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