Skip to content

Commit

Permalink
Fix RSpec raise_error warning
Browse files Browse the repository at this point in the history
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. Actual error raised was #<RuntimeError: Aligment must be one of: left center right>. Instead consider providing a specific error class or message. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives
  • Loading branch information
JuanitoFatas committed Oct 3, 2016
1 parent c022d51 commit b3d2ca6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spec/cell_spec.rb
Expand Up @@ -20,7 +20,7 @@
@cell.alignment = :left
@cell.alignment = :right
@cell.alignment = :center
lambda { @cell.alignment = "foo" }.should raise_error
lambda { @cell.alignment = "foo" }.should raise_error(RuntimeError)
end

it "should allow multiline content" do
Expand Down

0 comments on commit b3d2ca6

Please sign in to comment.