Class: Pact::RSpec::Matchers::MatchHeader
- Inherits:
-
Object
- Object
- Pact::RSpec::Matchers::MatchHeader
- Includes:
- Matchers, Matchers::Messages, RSpec2Delegator
- Defined in:
- lib/pact/provider/rspec/matchers.rb
Instance Method Summary collapse
- #failure_message ⇒ Object
-
#initialize(header_name, expected) ⇒ MatchHeader
constructor
A new instance of MatchHeader.
- #matches?(actual) ⇒ Boolean
Methods included from RSpec2Delegator
Methods included from Matchers::Messages
#expected_desc_for_it, #match_header_failure_message, #match_term_failure_message
Constructor Details
#initialize(header_name, expected) ⇒ MatchHeader
Returns a new instance of MatchHeader.
60 61 62 63 |
# File 'lib/pact/provider/rspec/matchers.rb', line 60 def initialize header_name, expected @header_name = header_name @expected = expected end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Pact::RSpec::Matchers::RSpec2Delegator
Instance Method Details
#failure_message ⇒ Object
70 71 72 |
# File 'lib/pact/provider/rspec/matchers.rb', line 70 def @header_name, @expected, @actual end |
#matches?(actual) ⇒ Boolean
65 66 67 68 |
# File 'lib/pact/provider/rspec/matchers.rb', line 65 def matches? actual @actual = actual diff(@expected, @actual).empty? end |