Class: RSpec::LiveControllers::Matchers::Base
- Inherits:
-
Object
- Object
- RSpec::LiveControllers::Matchers::Base
- Defined in:
- lib/rspec/live_controllers/matchers/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#actual_matcher ⇒ Object
readonly
Returns the value of attribute actual_matcher.
-
#list_of_matchers ⇒ Object
readonly
Returns the value of attribute list_of_matchers.
-
#response_body ⇒ Object
readonly
Returns the value of attribute response_body.
-
#target_response ⇒ Object
readonly
Returns the value of attribute target_response.
Instance Method Summary collapse
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
-
#initialize(actual_matcher) ⇒ Base
constructor
A new instance of Base.
- #matches?(target_response) ⇒ Boolean
Constructor Details
#initialize(actual_matcher) ⇒ Base
Returns a new instance of Base.
7 8 9 |
# File 'lib/rspec/live_controllers/matchers/base.rb', line 7 def initialize(actual_matcher) @actual_matcher = actual_matcher end |
Instance Attribute Details
#actual_matcher ⇒ Object (readonly)
Returns the value of attribute actual_matcher.
5 6 7 |
# File 'lib/rspec/live_controllers/matchers/base.rb', line 5 def actual_matcher @actual_matcher end |
#list_of_matchers ⇒ Object (readonly)
Returns the value of attribute list_of_matchers.
5 6 7 |
# File 'lib/rspec/live_controllers/matchers/base.rb', line 5 def list_of_matchers @list_of_matchers end |
#response_body ⇒ Object (readonly)
Returns the value of attribute response_body.
5 6 7 |
# File 'lib/rspec/live_controllers/matchers/base.rb', line 5 def response_body @response_body end |
#target_response ⇒ Object (readonly)
Returns the value of attribute target_response.
5 6 7 |
# File 'lib/rspec/live_controllers/matchers/base.rb', line 5 def target_response @target_response end |
Instance Method Details
#failure_message ⇒ Object
20 21 22 |
# File 'lib/rspec/live_controllers/matchers/base.rb', line 20 def raise 'Not implemented' end |
#failure_message_when_negated ⇒ Object
24 25 26 |
# File 'lib/rspec/live_controllers/matchers/base.rb', line 24 def raise 'Not implemented' end |
#matches?(target_response) ⇒ Boolean
11 12 13 14 15 16 17 18 |
# File 'lib/rspec/live_controllers/matchers/base.rb', line 11 def matches?(target_response) @target_response = target_response @response_body = extract_response_body(target_response) row = target_response_row(actual_matcher) json = target_response_json(actual_matcher) string = target_response_string(actual_matcher) check_matches?(response_body, row, json, string) end |