Skip to content

Commit 1e31ec7

Browse files
committed
(maint) be explicit about expected exception
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."
1 parent 9bc3b12 commit 1e31ec7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spec/puppet/resource_api/transport/wrapper_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class SomethingSomethingDarkside; end
109109

110110
context 'when using method?' do
111111
it 'will return false' do
112-
expect { instance.method :wibble }.to raise_error
112+
expect { instance.method :wibble }.to raise_error NameError, %r{undefined method `wibble'}
113113
end
114114
end
115115
end

0 commit comments

Comments
 (0)