Class: Lookout::Expectations::State
- Includes:
- Lookout::Expectation
- Defined in:
- lib/lookout/expectations/state.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Warning
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
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/lookout/expectations/state.rb', line 8 def evaluate_with_stubs check(@block ? instance_exec(@expected, &@block) : false) rescue Exception => e return check(e) if StandardError === @expected and @expected.class == e.class return Lookout::Results::Fulfilled.new(file, line) if @expected.eql? e.class Lookout::Results::Error.new(file, line, if Class === @expected and StandardError >= @expected Lookout::Equality.(@expected, e.class) elsif StandardError === @expected Lookout::Equality.(@expected.class, e.class) else nil end, e) end |