From 1e31ec7e0e6cf2b37e98907e1642e9ddb4dc8b25 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Fri, 10 May 2019 13:39:18 +0100 Subject: [PATCH] (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." --- spec/puppet/resource_api/transport/wrapper_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/puppet/resource_api/transport/wrapper_spec.rb b/spec/puppet/resource_api/transport/wrapper_spec.rb index 1b56c20d..744c3a0a 100644 --- a/spec/puppet/resource_api/transport/wrapper_spec.rb +++ b/spec/puppet/resource_api/transport/wrapper_spec.rb @@ -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