summaryrefslogtreecommitdiff
path: root/spec/ruby/core/mutex/unlock_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/mutex/unlock_spec.rb')
-rw-r--r--spec/ruby/core/mutex/unlock_spec.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/ruby/core/mutex/unlock_spec.rb b/spec/ruby/core/mutex/unlock_spec.rb
index 4601fde634..ed493cf84a 100644
--- a/spec/ruby/core/mutex/unlock_spec.rb
+++ b/spec/ruby/core/mutex/unlock_spec.rb
@@ -1,9 +1,9 @@
-require File.expand_path('../../../spec_helper', __FILE__)
+require_relative '../../spec_helper'
describe "Mutex#unlock" do
it "raises ThreadError unless Mutex is locked" do
mutex = Mutex.new
- lambda { mutex.unlock }.should raise_error(ThreadError)
+ -> { mutex.unlock }.should.raise(ThreadError)
end
it "raises ThreadError unless thread owns Mutex" do
@@ -17,9 +17,9 @@ describe "Mutex#unlock" do
# avoid race on mutex.lock
Thread.pass until mutex.locked?
- Thread.pass while th.status and th.status != "sleep"
+ Thread.pass until th.stop?
- lambda { mutex.unlock }.should raise_error(ThreadError)
+ -> { mutex.unlock }.should.raise(ThreadError)
wait.unlock
th.join
@@ -33,6 +33,6 @@ describe "Mutex#unlock" do
th.join
- lambda { mutex.unlock }.should raise_error(ThreadError)
+ -> { mutex.unlock }.should.raise(ThreadError)
end
end