Class: StraightJacket::Match
- Inherits:
-
Object
- Object
- StraightJacket::Match
- Defined in:
- lib/straight_jacket/match.rb
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message_for_should ⇒ Object
- #failure_message_for_should_not ⇒ Object
-
#initialize(request) ⇒ Match
constructor
A new instance of Match.
- #matches?(constrainer) ⇒ Boolean
Constructor Details
#initialize(request) ⇒ Match
Returns a new instance of Match.
5 6 7 |
# File 'lib/straight_jacket/match.rb', line 5 def initialize(request) @request = request end |
Instance Method Details
#description ⇒ Object
22 23 24 |
# File 'lib/straight_jacket/match.rb', line 22 def description "match parameters #{request.parameters}" end |
#failure_message_for_should ⇒ Object
14 15 16 |
# File 'lib/straight_jacket/match.rb', line 14 def "expected #{actual} to match #{request.parameters} but did not" end |
#failure_message_for_should_not ⇒ Object
18 19 20 |
# File 'lib/straight_jacket/match.rb', line 18 def "expected #{actual} not to match #{request.parameters} but did" end |
#matches?(constrainer) ⇒ Boolean
9 10 11 12 |
# File 'lib/straight_jacket/match.rb', line 9 def matches?(constrainer) @actual = constrainer constrainer.matches?(request) end |