1 parent 3fd4932 commit 2825cfaCopy full SHA for 2825cfa
1 file changed
spec/concurrent/atomic/read_write_lock_spec.rb
@@ -496,15 +496,11 @@ module Concurrent
496
497
it 'raises an exception if called by a thread that did not acquire the write lock' do
498
subject.acquire_write_lock
499
- intruder_error = nil
500
- Thread.new do
501
- begin
+ Thread.new {
+ expect {
502
subject.release_write_lock
503
- rescue => e
504
- intruder_error = e
505
- end
506
- end.join
507
- expect(intruder_error).to be_a(IllegalOperationError)
+ }.to raise_error(IllegalOperationError)
+ }.join
508
509
end
510
0 commit comments