Module: Cuprum::Rails::RSpec::Matchers
- Defined in:
- lib/cuprum/rails/rspec/matchers.rb,
lib/cuprum/rails/rspec/matchers/be_a_result_matcher.rb
Overview
Namespace for custom RSpec matchers.
Defined Under Namespace
Classes: BeAResultMatcher
Instance Method Summary collapse
-
#be_a_failing_result(expected_class = nil) ⇒ Cuprum::Rails::RSpec::Matchers::BeAResultMatcher
Asserts that the object is a result with status: :failure.
-
#be_a_passing_result(expected_class = nil) ⇒ Cuprum::Rails::RSpec::Matchers::BeAResultMatcher
Asserts that the object is a Cuprum::Result with status: :success.
-
#be_a_result(expected_class = nil) ⇒ Cuprum::Rails::RSpec::Matchers::BeAResultMatcher
Asserts that the object is a Cuprum::Result.
Instance Method Details
#be_a_failing_result(expected_class = nil) ⇒ Cuprum::Rails::RSpec::Matchers::BeAResultMatcher
Asserts that the object is a result with status: :failure.
18 19 20 |
# File 'lib/cuprum/rails/rspec/matchers.rb', line 18 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::Rails::RSpec::Matchers::BeAResultMatcher
Asserts that the object is a Cuprum::Result with status: :success.
29 30 31 |
# File 'lib/cuprum/rails/rspec/matchers.rb', line 29 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::Rails::RSpec::Matchers::BeAResultMatcher
Asserts that the object is a Cuprum::Result.
37 38 39 |
# File 'lib/cuprum/rails/rspec/matchers.rb', line 37 def be_a_result(expected_class = nil) Cuprum::Rails::RSpec::Matchers::BeAResultMatcher.new(expected_class) end |