diff options
Diffstat (limited to 'spec/ruby/core/thread/shared')
| -rw-r--r-- | spec/ruby/core/thread/shared/exit.rb | 6 | ||||
| -rw-r--r-- | spec/ruby/core/thread/shared/start.rb | 8 | ||||
| -rw-r--r-- | spec/ruby/core/thread/shared/to_s.rb | 20 | ||||
| -rw-r--r-- | spec/ruby/core/thread/shared/wakeup.rb | 2 |
4 files changed, 18 insertions, 18 deletions
diff --git a/spec/ruby/core/thread/shared/exit.rb b/spec/ruby/core/thread/shared/exit.rb index 13e8832684..a294c3a4d6 100644 --- a/spec/ruby/core/thread/shared/exit.rb +++ b/spec/ruby/core/thread/shared/exit.rb @@ -56,8 +56,8 @@ describe :thread_exit, shared: true do Thread.pass while @inner.status and @inner.status != "sleep" @outer.send(@method) @outer.join - ScratchPad.recorded.should include(:inner_ensure_clause) - ScratchPad.recorded.should include(:outer_ensure_clause) + ScratchPad.recorded.should.include?(:inner_ensure_clause) + ScratchPad.recorded.should.include?(:outer_ensure_clause) end it "does not set $!" do @@ -155,7 +155,7 @@ describe :thread_exit, shared: true do it "propagates inner exception to Thread.join if there is an outer ensure clause" do thread = ThreadSpecs.dying_thread_with_outer_ensure(@method) { } - -> { thread.join }.should raise_error(RuntimeError, "In dying thread") + -> { thread.join }.should.raise(RuntimeError, "In dying thread") end it "runs all outer ensure clauses even if inner ensure clause raises exception" do diff --git a/spec/ruby/core/thread/shared/start.rb b/spec/ruby/core/thread/shared/start.rb index 2ba926bf00..c5d62ab098 100644 --- a/spec/ruby/core/thread/shared/start.rb +++ b/spec/ruby/core/thread/shared/start.rb @@ -6,22 +6,22 @@ describe :thread_start, shared: true do it "raises an ArgumentError if not passed a block" do -> { Thread.send(@method) - }.should raise_error(ArgumentError) + }.should.raise(ArgumentError) end it "spawns a new Thread running the block" do run = false t = Thread.send(@method) { run = true } - t.should be_kind_of(Thread) + t.should.is_a?(Thread) t.join - run.should be_true + run.should == true end it "respects Thread subclasses" do c = Class.new(Thread) t = c.send(@method) { } - t.should be_kind_of(c) + t.should.is_a?(c) t.join end diff --git a/spec/ruby/core/thread/shared/to_s.rb b/spec/ruby/core/thread/shared/to_s.rb index 43640deb33..27e53ba4b8 100644 --- a/spec/ruby/core/thread/shared/to_s.rb +++ b/spec/ruby/core/thread/shared/to_s.rb @@ -12,42 +12,42 @@ describe :thread_to_s, shared: true do end it "can check it's own status" do - ThreadSpecs.status_of_current_thread.send(@method).should include('run') + ThreadSpecs.status_of_current_thread.send(@method).should.include?('run') end it "describes a running thread" do - ThreadSpecs.status_of_running_thread.send(@method).should include('run') + ThreadSpecs.status_of_running_thread.send(@method).should.include?('run') end it "describes a sleeping thread" do - ThreadSpecs.status_of_sleeping_thread.send(@method).should include('sleep') + ThreadSpecs.status_of_sleeping_thread.send(@method).should.include?('sleep') end it "describes a blocked thread" do - ThreadSpecs.status_of_blocked_thread.send(@method).should include('sleep') + ThreadSpecs.status_of_blocked_thread.send(@method).should.include?('sleep') end it "describes a completed thread" do - ThreadSpecs.status_of_completed_thread.send(@method).should include('dead') + ThreadSpecs.status_of_completed_thread.send(@method).should.include?('dead') end it "describes a killed thread" do - ThreadSpecs.status_of_killed_thread.send(@method).should include('dead') + ThreadSpecs.status_of_killed_thread.send(@method).should.include?('dead') end it "describes a thread with an uncaught exception" do - ThreadSpecs.status_of_thread_with_uncaught_exception.send(@method).should include('dead') + ThreadSpecs.status_of_thread_with_uncaught_exception.send(@method).should.include?('dead') end it "describes a dying sleeping thread" do - ThreadSpecs.status_of_dying_sleeping_thread.send(@method).should include('sleep') + ThreadSpecs.status_of_dying_sleeping_thread.send(@method).should.include?('sleep') end it "reports aborting on a killed thread" do - ThreadSpecs.status_of_dying_running_thread.send(@method).should include('aborting') + ThreadSpecs.status_of_dying_running_thread.send(@method).should.include?('aborting') end it "reports aborting on a killed thread after sleep" do - ThreadSpecs.status_of_dying_thread_after_sleep.send(@method).should include('aborting') + ThreadSpecs.status_of_dying_thread_after_sleep.send(@method).should.include?('aborting') end end diff --git a/spec/ruby/core/thread/shared/wakeup.rb b/spec/ruby/core/thread/shared/wakeup.rb index 6f010fea25..c89235ba60 100644 --- a/spec/ruby/core/thread/shared/wakeup.rb +++ b/spec/ruby/core/thread/shared/wakeup.rb @@ -57,6 +57,6 @@ describe :thread_wakeup, shared: true do it "raises a ThreadError when trying to wake up a dead thread" do t = Thread.new { 1 } t.join - -> { t.send @method }.should raise_error(ThreadError) + -> { t.send @method }.should.raise(ThreadError) end end |
