Class: Cuprum::Rails::RSpec::Matchers::BeAResultMatcher
- Inherits:
-
Cuprum::RSpec::BeAResultMatcher
- Object
- Cuprum::RSpec::BeAResultMatcher
- Cuprum::Rails::RSpec::Matchers::BeAResultMatcher
- Defined in:
- lib/cuprum/rails/rspec/matchers/be_a_result_matcher.rb
Overview
Asserts the actual object is a result object with the specified properties.
Instance Method Summary collapse
-
#initialize(expected_class = nil) ⇒ BeAResultMatcher
constructor
A new instance of BeAResultMatcher.
-
#with_metadata(metadata) ⇒ Object
(also: #and_metadata)
Sets a metadata expectation on the matcher.
Constructor Details
#initialize(expected_class = nil) ⇒ BeAResultMatcher
Returns a new instance of BeAResultMatcher.
12 13 14 15 16 |
# File 'lib/cuprum/rails/rspec/matchers/be_a_result_matcher.rb', line 12 def initialize(expected_class = nil) super @expected_metadata = DEFAULT_VALUE end |
Instance Method Details
#with_metadata(metadata) ⇒ Object Also known as: and_metadata
Sets a metadata expectation on the matcher.
Calls to #matches? will fail unless the result responds to #metadata? and has the specified metadata.
22 23 24 25 26 |
# File 'lib/cuprum/rails/rspec/matchers/be_a_result_matcher.rb', line 22 def () @expected_metadata = self end |