Class: SuperDiff::EqualityMatchers::Primitive
- Defined in:
- lib/super_diff/equality_matchers/primitive.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Base
Class Method Details
.applies_to?(value) ⇒ Boolean
4 5 6 7 8 9 10 |
# File 'lib/super_diff/equality_matchers/primitive.rb', line 4 def self.applies_to?(value) value.is_a?(Symbol) || value.is_a?(Numeric) || # TODO: Test this value == true || value == false end |
Instance Method Details
#fail ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/super_diff/equality_matchers/primitive.rb', line 12 def fail <<~OUTPUT.strip Differing #{Helpers.plural_type_for(actual)}. #{ Helpers.style( :alpha, "Expected: " + ObjectInspection.inspect(expected, as_single_line: true), ) } #{ Helpers.style( :beta, " Actual: " + ObjectInspection.inspect(actual, as_single_line: true), ) } OUTPUT end |