Class: Lookout::Difference::Exception
- Defined in:
- lib/lookout-3.0/difference/exception.rb
Overview
Instance Attribute Summary
Attributes inherited from Object
Instance Method Summary collapse
-
#diff ⇒ Enumerable<String>, super
The result of String#diff between Object#expected’s message and Object#actual’s message if Object#actual and Object#expected are of the same class and Object#expected and Object#actual’s messages are Strings, super otherwise.
-
#initialize(actual, expected, regexp = nil) ⇒ Exception
constructor
Initializes a difference report between the ACTUAL result and the EXPECTED value, where REGEXP is the Regexp found inside EXPECTED, if any.
Methods inherited from Object
Constructor Details
#initialize(actual, expected, regexp = nil) ⇒ Exception
Initializes a difference report between the ACTUAL result and the EXPECTED value, where REGEXP is the Regexp found inside EXPECTED, if any.
13 14 15 16 |
# File 'lib/lookout-3.0/difference/exception.rb', line 13 def initialize(actual, expected, regexp = nil) @regexp = regexp super actual, expected end |
Instance Method Details
#diff ⇒ Enumerable<String>, super
Returns The result of String#diff between Object#expected’s message and Object#actual’s message if Object#actual and Object#expected are of the same class and Object#expected and Object#actual’s messages are Strings, super otherwise.
22 23 24 25 26 27 28 29 |
# File 'lib/lookout-3.0/difference/exception.rb', line 22 def diff return super unless expected.class == actual.class and String === expected. and not @regexp and (m = actual. rescue nil) and String === m expected..to_lookout_expected.difference(m).diff end |