Class: RSpecApi::Matchers::Status::Matcher
- Inherits:
-
Response::Matcher
- Object
- Response::Matcher
- RSpecApi::Matchers::Status::Matcher
- Defined in:
- lib/rspec-api/matchers/status/matcher.rb
Instance Attribute Summary collapse
-
#status_symbol_or_code ⇒ Object
Returns the value of attribute status_symbol_or_code.
Attributes inherited from Response::Matcher
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(status_symbol_or_code) ⇒ Matcher
constructor
A new instance of Matcher.
- #matches?(response) ⇒ Boolean
Methods inherited from Response::Matcher
#failure_message_for_should, #failure_message_for_should_not
Constructor Details
#initialize(status_symbol_or_code) ⇒ Matcher
Returns a new instance of Matcher.
10 11 12 |
# File 'lib/rspec-api/matchers/status/matcher.rb', line 10 def initialize(status_symbol_or_code) @status_symbol_or_code = status_symbol_or_code end |
Instance Attribute Details
#status_symbol_or_code ⇒ Object
Returns the value of attribute status_symbol_or_code.
8 9 10 |
# File 'lib/rspec-api/matchers/status/matcher.rb', line 8 def status_symbol_or_code @status_symbol_or_code end |
Instance Method Details
#description ⇒ Object
18 19 20 |
# File 'lib/rspec-api/matchers/status/matcher.rb', line 18 def description "be #{status_code}" end |
#matches?(response) ⇒ Boolean
14 15 16 |
# File 'lib/rspec-api/matchers/status/matcher.rb', line 14 def matches?(response) super && status == status_code end |