Class: Lookout::Expected::String

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

Overview

Represents expected Strings.

Instance Method Summary collapse

Methods inherited from Object

#expect

Instance Method Details

#difference(actual) ⇒ Difference::String?

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

Parameters:

Returns:

  • (Difference::String, nil)

    A difference report between ACTUAL and #expected unless they’re ‘#==`



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

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