Skip to content

Commit 2825cfa

Browse files
committed
Cleanup spec
1 parent 3fd4932 commit 2825cfa

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

‎spec/concurrent/atomic/read_write_lock_spec.rb‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -496,15 +496,11 @@ module Concurrent
496496

497497
it 'raises an exception if called by a thread that did not acquire the write lock' do
498498
subject.acquire_write_lock
499-
intruder_error = nil
500-
Thread.new do
501-
begin
499+
Thread.new {
500+
expect {
502501
subject.release_write_lock
503-
rescue => e
504-
intruder_error = e
505-
end
506-
end.join
507-
expect(intruder_error).to be_a(IllegalOperationError)
502+
}.to raise_error(IllegalOperationError)
503+
}.join
508504
subject.release_write_lock
509505
end
510506
end

0 commit comments

Comments
 (0)