Class: Truenames::Matchers::ExprEq
- Inherits:
-
RSpec::Matchers::BuiltIn::Eq
- Object
- RSpec::Matchers::BuiltIn::Eq
- Truenames::Matchers::ExprEq
- Defined in:
- lib/truenames/matchers/expr_eq.rb
Instance Method Summary collapse
- #failure_message_for_should ⇒ Object
-
#initialize(expected = nil) ⇒ ExprEq
constructor
A new instance of ExprEq.
- #name ⇒ Object
Constructor Details
#initialize(expected = nil) ⇒ ExprEq
Returns a new instance of ExprEq.
11 12 13 14 15 16 |
# File 'lib/truenames/matchers/expr_eq.rb', line 11 def initialize(expected = nil) @expected = expected # One to escape this binding, one to escape the Truenames::Matchers#expr_eq wrapper method @binding = binding.of_caller(2) end |
Instance Method Details
#failure_message_for_should ⇒ Object
22 23 24 25 |
# File 'lib/truenames/matchers/expr_eq.rb', line 22 def "\nexpected: #{expected.inspect}#{inspect_references_for(expected)}\n" + " got: #{actual.inspect}#{inspect_references_for(actual)}\n\n(compared using ==)\n" end |
#name ⇒ Object
18 19 20 |
# File 'lib/truenames/matchers/expr_eq.rb', line 18 def name "eq" end |