Skip to content

Conversation

carbonin
Copy link
Member

@carbonin carbonin commented Oct 7, 2015

This removes warnings of the form:

WARNING: Using the `raise_error` matcher without providing a specific error or message risks false 
positives, since `raise_error` will match when Ruby raises a `NoMethodError`, `NameError` or 
`ArgumentError`, potentially allowing the expectation to pass without even executing the method you 
are intending to call. Instead consider providing a specific error class or message. This message can 
be supressed by setting: `RSpec::Expectations.configuration.warn_about_potential_false_positives = 
false`.

@Fryguy
Copy link
Member

Fryguy commented Oct 7, 2015

👍

spec/yum_spec.rb Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a RuntimeError

This removes warnings when running spec tests
@carbonin carbonin force-pushed the remove_raise_error_warnings branch from 7e9b8a3 to fc1686b Compare October 14, 2015 18:05
@miq-bot
Copy link
Member

miq-bot commented Oct 14, 2015

Checked commit carbonin@fc1686b with ruby 1.9.3, rubocop 0.34.2, and haml-lint 0.13.0
2 files checked, 0 offenses detected
Everything looks good. 🍪

@bdunne
Copy link
Member

bdunne commented Oct 14, 2015

👍 Will merge when Green

bdunne added a commit that referenced this pull request Oct 14, 2015
Added error class to rspec raise_error expectations
@bdunne bdunne merged commit 759b09a into ManageIQ:master Oct 14, 2015
@carbonin carbonin deleted the remove_raise_error_warnings branch November 13, 2015 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants