Class: Hardmock::StubbedMethod
Overview
Instance Attribute Summary
#method_name, #target
Instance Method Summary
collapse
#initialize
Instance Method Details
#invoke(args) ⇒ Object
67
68
69
70
|
# File 'lib/hardmock/stubbing.rb', line 67
def invoke(args)
raise @raises if @raises
@return_value
end
|
#raises(err) ⇒ Object
76
77
78
79
|
# File 'lib/hardmock/stubbing.rb', line 76
def raises(err)
err = RuntimeError.new(err) unless err.kind_of?(Exception)
@raises = err
end
|
#returns(stubbed_return) ⇒ Object
72
73
74
|
# File 'lib/hardmock/stubbing.rb', line 72
def returns(stubbed_return)
@return_value = stubbed_return
end
|