File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -149,10 +149,11 @@ module Concurrent
149
149
} . to raise_error ( Concurrent ::ResourceLimitError )
150
150
end
151
151
152
- it 'does not release the lock when an exception is raised' do
153
- expect ( subject ) . to_not receive ( :release_read_lock ) . with ( any_args )
154
- lambda do
155
- subject . with_read_lock { raise StandardError }
152
+ it 'releases the lock when an exception is raised' do
153
+ expect ( subject ) . to receive ( :release_read_lock ) . with ( any_args )
154
+ begin
155
+ subject . release_read_lock { raise StandardError }
156
+ rescue
156
157
end
157
158
end
158
159
end
@@ -189,10 +190,11 @@ module Concurrent
189
190
} . to raise_error ( Concurrent ::ResourceLimitError )
190
191
end
191
192
192
- it 'does not release the lock when an exception is raised' do
193
- expect ( subject ) . to_not receive ( :release_write_lock ) . with ( any_args )
194
- lambda do
193
+ it 'releases the lock when an exception is raised' do
194
+ expect ( subject ) . to receive ( :release_write_lock ) . with ( any_args )
195
+ begin
195
196
subject . with_write_lock { raise StandardError }
197
+ rescue
196
198
end
197
199
end
198
200
end
You can’t perform that action at this time.
0 commit comments