Class: Reins::Spec::Matchers::HaveHttpStatus
- Inherits:
-
Object
- Object
- Reins::Spec::Matchers::HaveHttpStatus
- Defined in:
- lib/reins/spec/matchers.rb
Instance Method Summary collapse
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
-
#initialize(expected) ⇒ HaveHttpStatus
constructor
A new instance of HaveHttpStatus.
- #matches?(response) ⇒ Boolean
Constructor Details
#initialize(expected) ⇒ HaveHttpStatus
Returns a new instance of HaveHttpStatus.
7 8 9 |
# File 'lib/reins/spec/matchers.rb', line 7 def initialize(expected) @expected = resolve(expected) end |
Instance Method Details
#failure_message ⇒ Object
16 17 18 |
# File 'lib/reins/spec/matchers.rb', line 16 def "expected response to have status #{@expected}, got #{@actual}" end |
#failure_message_when_negated ⇒ Object
20 21 22 |
# File 'lib/reins/spec/matchers.rb', line 20 def "expected response not to have status #{@expected}" end |
#matches?(response) ⇒ Boolean
11 12 13 14 |
# File 'lib/reins/spec/matchers.rb', line 11 def matches?(response) @actual = response.status @actual == @expected end |