Class: SuperDiff::EqualityMatchers::Primitive

Inherits:
Base
  • Object
show all
Defined in:
lib/super_diff/equality_matchers/primitive.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
9
# File 'lib/super_diff/equality_matchers/primitive.rb', line 6

def self.applies_to?(value)
  # TODO: Test all of these options
  SuperDiff.primitive?(value)
end

Instance Method Details

#failObject



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

def fail
  "      Differing \#{Core::Helpers.plural_type_for(actual)}.\n\n      \#{\n      Core::Helpers.style(\n        :expected,\n        \"Expected: \#{SuperDiff.inspect_object(expected, as_lines: false)}\"\n      )\n    }\n      \#{\n      Core::Helpers.style(\n        :actual,\n        \"  Actual: \#{SuperDiff.inspect_object(actual, as_lines: false)}\"\n      )\n    }\n  OUTPUT\nend\n".strip