Skip to content

Commit

Permalink
Making tests a bit better
Browse files Browse the repository at this point in the history
  • Loading branch information
bmalinconico committed Sep 1, 2022
1 parent d0ff758 commit 651a66c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions spec/lib/rspec/sorbet_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class Animal; end
end

describe 'with an existing error handler' do
let(:handler) { proc {|_,_| } }
let(:handler) { proc {|_,_| raise ArgumentError, 'foo'} }

before do
T::Configuration.call_validation_error_handler = handler
Expand All @@ -150,10 +150,8 @@ def initialize(message)
end

specify do
expect(handler).to receive(:call)

# Error is not rasied becasue handler is no-op
expect { PassthroughSig.new(123) }.not_to raise_error
expect { PassthroughSig.new(123) }.to raise_error ArgumentError, 'foo'
end

end
Expand Down

0 comments on commit 651a66c

Please sign in to comment.