Class: Specifier::Matcher::Equal

Inherits:
Base
  • Object
show all
Defined in:
lib/specifier/matcher/equal.rb

Instance Attribute Summary

Attributes inherited from Base

#expected

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Equal

Returns a new instance of Equal.



4
5
6
# File 'lib/specifier/matcher/equal.rb', line 4

def initialize(value)
  @value = value
end

Instance Method Details

#match?(expected) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
11
# File 'lib/specifier/matcher/equal.rb', line 8

def match?(expected)
  super
  expected.eql?(@value)
end

#messageObject



13
14
15
# File 'lib/specifier/matcher/equal.rb', line 13

def message
  "expected #{@expected.inspect} got #{@value.inspect}"
end