Skip to content

Commit

Permalink
fix - WARNING: Using the 'raise_error' matcher without providing a sp…
Browse files Browse the repository at this point in the history
…ecific error or message risks false positives
  • Loading branch information
rocket-turtle committed Jun 2, 2023
1 parent a5f10d2 commit 39528cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
end

it 'should raise ArgumentError when bogus config specified' do
expect { @proxy.config(:bogus) }.to raise_error
expect { @proxy.config(:bogus) }.to raise_error(ArgumentError)
end

it_should_behave_like 'session proxy'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require File.expand_path('spec_helper', File.dirname(__FILE__))

describe Sunspot::SessionProxy::Retry5xxSessionProxy do

before :each do
Sunspot::Session.connection_class = Mock::ConnectionFactory.new
@sunspot_session = Sunspot.session
Expand Down Expand Up @@ -70,12 +70,12 @@ def fake_rsolr_response(status)
it "should not retry a 4xx" do
e = FakeRSolrErrorHttp.new(fake_rsolr_request, fake_rsolr_response(400))
expect(@sunspot_session).to receive(:index).and_raise(e)
expect { Sunspot.index(post) }.to raise_error
expect { Sunspot.index(post) }.to raise_error(FakeRSolrErrorHttp)
end

# TODO: try against more than just Sunspot.index? but that's just testing the
# invocation of delegate, so probably not important. -nz 11Apr12

it_should_behave_like 'session proxy'

end

0 comments on commit 39528cd

Please sign in to comment.