Class: Lookout::Expected::Regexp

Inherits:
Object show all
Defined in:
lib/lookout-3.0/expected/regexp.rb

Overview

Represents expected Regexps.

Instance Method Summary collapse

Methods inherited from Object

#expect

Instance Method Details

#difference(actual) ⇒ Difference::Regexp?

Returns A difference report between ACTUAL and #expected unless they’re ‘#==` or ACTUAL is matched by #expected.

Parameters:

Returns:

  • (Difference::Regexp, nil)

    A difference report between ACTUAL and #expected unless they’re ‘#==` or ACTUAL is matched by #expected



8
9
10
11
# File 'lib/lookout-3.0/expected/regexp.rb', line 8

def difference(actual)
  Lookout::Difference::Regexp.new(actual, expected) unless
    expected == actual or expected === actual
end