Module: Cuprum::RSpec::Matchers

Defined in:
lib/cuprum/rspec/be_a_result.rb,
lib/cuprum/rspec/be_callable.rb

Overview

rubocop:disable Style/Documentation

Instance Method Summary collapse

Instance Method Details

#be_a_failing_result(expected_class = nil) ⇒ Cuprum::RSpec::BeAResultMatcher

Asserts that the object is a result with status: :failure.

Parameters:

  • expected_class (Class) (defaults to: nil)

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

Returns:



13
14
15
# File 'lib/cuprum/rspec/be_a_result.rb', line 13

def be_a_failing_result(expected_class = nil)
  be_a_result(expected_class).with_status(:failure)
end

#be_a_passing_result(expected_class = nil) ⇒ Cuprum::RSpec::BeAResultMatcher

Asserts that the object is a Cuprum::Result with status: :success.

Parameters:

  • expected_class (Class) (defaults to: nil)

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

Returns:



23
24
25
# File 'lib/cuprum/rspec/be_a_result.rb', line 23

def be_a_passing_result(expected_class = nil)
  be_a_result(expected_class).with_status(:success).and_error(nil)
end

#be_a_result(expected_class = nil) ⇒ Cuprum::RSpec::BeAResultMatcher

Asserts that the object is a Cuprum::Result.

Returns:



30
31
32
# File 'lib/cuprum/rspec/be_a_result.rb', line 30

def be_a_result(expected_class = nil)
  Cuprum::RSpec::BeAResultMatcher.new(expected_class)
end

#be_callableRSpec::Matchers::BuiltIn::RespondTo

Asserts that the command defines a :process method.

Returns:

  • (RSpec::Matchers::BuiltIn::RespondTo)

    the generated matcher.



10
11
12
# File 'lib/cuprum/rspec/be_callable.rb', line 10

def be_callable
  respond_to(:process, true)
end