diff --git a/spec/ruby/core/thread/raise_spec.rb b/spec/ruby/core/thread/raise_spec.rb index 20c8b149b8..f325622f24 100644 --- a/spec/ruby/core/thread/raise_spec.rb +++ b/spec/ruby/core/thread/raise_spec.rb @@ -6,8 +6,8 @@ describe "Thread#raise" do it "ignores dead threads" do t = Thread.new { :dead } Thread.pass while t.alive? - lambda {t.raise("Kill the thread")}.should_not raise_error - lambda {t.value}.should_not raise_error + -> { t.raise("Kill the thread") }.should_not raise_error + -> { t.value }.should_not raise_error end end @@ -58,7 +58,7 @@ describe "Thread#raise on a sleeping thread" do ThreadSpecs.spin_until_sleeping(t) t.raise - lambda { t.value }.should raise_error(RuntimeError) + -> { t.value }.should raise_error(RuntimeError) end it "raises a RuntimeError when called with no arguments inside rescue" do @@ -76,7 +76,7 @@ describe "Thread#raise on a sleeping thread" do ThreadSpecs.spin_until_sleeping(t) t.raise end - lambda {t.value}.should raise_error(RuntimeError) + -> { t.value }.should raise_error(RuntimeError) end end @@ -120,7 +120,7 @@ describe "Thread#raise on a running thread" do end t.raise - lambda {t.value}.should raise_error(RuntimeError) + -> { t.value }.should raise_error(RuntimeError) end it "raises the given argument even when there is an active exception" do @@ -139,7 +139,7 @@ describe "Thread#raise on a running thread" do rescue Thread.pass until raised t.raise RangeError - lambda {t.value}.should raise_error(RangeError) + -> { t.value }.should raise_error(RangeError) end end @@ -160,7 +160,7 @@ describe "Thread#raise on a running thread" do Thread.pass until raised t.raise end - lambda {t.value}.should raise_error(RuntimeError) + -> { t.value }.should raise_error(RuntimeError) end end @@ -176,6 +176,6 @@ describe "Thread#raise on same thread" do Thread.current.raise end end - lambda {t.value}.should raise_error(RuntimeError) + -> { t.value }.should raise_error(RuntimeError) end end