Skip to content

Commit

Permalink
(maint) be explicit about expected exception
Browse files Browse the repository at this point in the history
This removes the rspec 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."
  • Loading branch information
DavidS committed May 16, 2019
1 parent 7ad796b commit 7ae2b22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spec/puppet/resource_api/transport/wrapper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class SomethingSomethingDarkside; end

context 'when using method?' do
it 'will return false' do
expect { instance.method :wibble }.to raise_error
expect { instance.method :wibble }.to raise_error NameError, %r{undefined method `wibble'}
end
end
end
Expand Down

0 comments on commit 7ae2b22

Please sign in to comment.