Class: Lookout::Expectations::Behavior
- Includes:
- Lookout::Expectation
- Defined in:
- lib/lookout/expectations/behavior.rb
Instance Attribute Summary
Attributes included from Lookout::Expectation
Instance Method Summary collapse
Methods included from Lookout::Expectation
#evaluate, #initialize, on, #stub, #with_verbose
Instance Method Details
#evaluate_with_stubs ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/lookout/expectations/behavior.rb', line 6 def evaluate_with_stubs Lookout::Mock.methods do |mocks| @expected.subject! mocks, @stubs instance_exec @expected.subject, &@block if @block @expected.verify end Lookout::Results::Fulfilled.new(file, line) rescue Lookout::Recorders::State::Error => e Lookout::Results::Failures::State.new(file, line, e.) rescue Lookout::Mock::Error => e Lookout::Results::Failures::Behavior.new(file, line, e.) rescue Exception => e Lookout::Results::Error.new(file, line, nil, e) end |