Class: SuperDiff::EqualityMatchers::SinglelineString

Inherits:
Base
  • Object
show all
Defined in:
lib/super_diff/equality_matchers/singleline_string.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#call

Class Method Details

.applies_to?(value) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/super_diff/equality_matchers/singleline_string.rb', line 6

def self.applies_to?(value)
  value.instance_of?(::String)
end

Instance Method Details

#failObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/super_diff/equality_matchers/singleline_string.rb', line 10

def fail
  <<~OUTPUT.strip
      Differing strings.

      #{
      Core::Helpers.style(
        :expected,
        "Expected: #{SuperDiff.inspect_object(expected, as_lines: false)}"
      )
    }
      #{
      Core::Helpers.style(
        :actual,
        "  Actual: #{SuperDiff.inspect_object(actual, as_lines: false)}"
      )
    }
  OUTPUT
end