Class: Cuprum::Rails::RSpec::Matchers::BeAResultMatcher

Inherits:
Cuprum::RSpec::BeAResultMatcher
  • Object
show all
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.

See Also:

  • Cuprum::RSpec::BeAResultMatcher.

Instance Method Summary collapse

Constructor Details

#initialize(expected_class = nil) ⇒ BeAResultMatcher

Returns a new instance of BeAResultMatcher.

Parameters:

  • expected_class (Class) (defaults to: nil)

    the expected class of result. Defaults to Cuprum::Result.



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