diff options
Diffstat (limited to 'spec/ruby/core/process/status')
| -rw-r--r-- | spec/ruby/core/process/status/bit_and_spec.rb | 6 | ||||
| -rw-r--r-- | spec/ruby/core/process/status/exited_spec.rb | 6 | ||||
| -rw-r--r-- | spec/ruby/core/process/status/right_shift_spec.rb | 6 | ||||
| -rw-r--r-- | spec/ruby/core/process/status/signaled_spec.rb | 6 | ||||
| -rw-r--r-- | spec/ruby/core/process/status/success_spec.rb | 8 | ||||
| -rw-r--r-- | spec/ruby/core/process/status/termsig_spec.rb | 4 | ||||
| -rw-r--r-- | spec/ruby/core/process/status/to_i_spec.rb | 4 | ||||
| -rw-r--r-- | spec/ruby/core/process/status/wait_spec.rb | 18 |
8 files changed, 29 insertions, 29 deletions
diff --git a/spec/ruby/core/process/status/bit_and_spec.rb b/spec/ruby/core/process/status/bit_and_spec.rb index 0e0edb0afa..a5b1123e90 100644 --- a/spec/ruby/core/process/status/bit_and_spec.rb +++ b/spec/ruby/core/process/status/bit_and_spec.rb @@ -1,6 +1,6 @@ require_relative '../../../spec_helper' -ruby_version_is ""..."3.5" do +ruby_version_is ""..."4.0" do describe "Process::Status#&" do it "returns a bitwise and of the integer status of an exited child" do @@ -17,13 +17,13 @@ ruby_version_is ""..."3.5" do end end - ruby_version_is "3.3"..."3.5" do + ruby_version_is ""..."4.0" do it "raises an ArgumentError if mask is negative" do suppress_warning do ruby_exe("exit(0)") -> { $? & -1 - }.should raise_error(ArgumentError, 'negative mask value: -1') + }.should.raise(ArgumentError, 'negative mask value: -1') end end diff --git a/spec/ruby/core/process/status/exited_spec.rb b/spec/ruby/core/process/status/exited_spec.rb index a61292b146..ad14b35000 100644 --- a/spec/ruby/core/process/status/exited_spec.rb +++ b/spec/ruby/core/process/status/exited_spec.rb @@ -7,7 +7,7 @@ describe "Process::Status#exited?" do end it "returns true" do - $?.exited?.should be_true + $?.exited?.should == true end end @@ -19,13 +19,13 @@ describe "Process::Status#exited?" do platform_is_not :windows do it "returns false" do - $?.exited?.should be_false + $?.exited?.should == false end end platform_is :windows do it "always returns true" do - $?.exited?.should be_true + $?.exited?.should == true end end end diff --git a/spec/ruby/core/process/status/right_shift_spec.rb b/spec/ruby/core/process/status/right_shift_spec.rb index a1ab75141a..5689526f54 100644 --- a/spec/ruby/core/process/status/right_shift_spec.rb +++ b/spec/ruby/core/process/status/right_shift_spec.rb @@ -1,6 +1,6 @@ require_relative '../../../spec_helper' -ruby_version_is ""..."3.5" do +ruby_version_is ""..."4.0" do describe "Process::Status#>>" do it "returns a right shift of the integer status of an exited child" do @@ -16,13 +16,13 @@ ruby_version_is ""..."3.5" do end end - ruby_version_is "3.3"..."3.5" do + ruby_version_is ""..."4.0" do it "raises an ArgumentError if shift value is negative" do suppress_warning do ruby_exe("exit(0)") -> { $? >> -1 - }.should raise_error(ArgumentError, 'negative shift value: -1') + }.should.raise(ArgumentError, 'negative shift value: -1') end end diff --git a/spec/ruby/core/process/status/signaled_spec.rb b/spec/ruby/core/process/status/signaled_spec.rb index c0de7b8006..8cf409bb42 100644 --- a/spec/ruby/core/process/status/signaled_spec.rb +++ b/spec/ruby/core/process/status/signaled_spec.rb @@ -7,7 +7,7 @@ describe "Process::Status#signaled?" do end it "returns false" do - $?.signaled?.should be_false + $?.signaled?.should == false end end @@ -18,13 +18,13 @@ describe "Process::Status#signaled?" do platform_is_not :windows do it "returns true" do - $?.signaled?.should be_true + $?.signaled?.should == true end end platform_is :windows do it "always returns false" do - $?.signaled?.should be_false + $?.signaled?.should == false end end end diff --git a/spec/ruby/core/process/status/success_spec.rb b/spec/ruby/core/process/status/success_spec.rb index 3589cc611f..f61243c667 100644 --- a/spec/ruby/core/process/status/success_spec.rb +++ b/spec/ruby/core/process/status/success_spec.rb @@ -7,7 +7,7 @@ describe "Process::Status#success?" do end it "returns true" do - $?.success?.should be_true + $?.success?.should == true end end @@ -17,7 +17,7 @@ describe "Process::Status#success?" do end it "returns false" do - $?.success?.should be_false + $?.success?.should == false end end @@ -28,13 +28,13 @@ describe "Process::Status#success?" do platform_is_not :windows do it "returns nil" do - $?.success?.should be_nil + $?.success?.should == nil end end platform_is :windows do it "always returns true" do - $?.success?.should be_true + $?.success?.should == true end end end diff --git a/spec/ruby/core/process/status/termsig_spec.rb b/spec/ruby/core/process/status/termsig_spec.rb index 9a22dbea71..1d57724d12 100644 --- a/spec/ruby/core/process/status/termsig_spec.rb +++ b/spec/ruby/core/process/status/termsig_spec.rb @@ -7,7 +7,7 @@ describe "Process::Status#termsig" do end it "returns nil" do - $?.termsig.should be_nil + $?.termsig.should == nil end end @@ -36,7 +36,7 @@ describe "Process::Status#termsig" do platform_is :windows do it "always returns nil" do - $?.termsig.should be_nil + $?.termsig.should == nil end end end diff --git a/spec/ruby/core/process/status/to_i_spec.rb b/spec/ruby/core/process/status/to_i_spec.rb index 39f8e2d84c..0bfb883d23 100644 --- a/spec/ruby/core/process/status/to_i_spec.rb +++ b/spec/ruby/core/process/status/to_i_spec.rb @@ -3,11 +3,11 @@ require_relative '../../../spec_helper' describe "Process::Status#to_i" do it "returns an integer when the child exits" do ruby_exe('exit 48', exit_status: 48) - $?.to_i.should be_an_instance_of(Integer) + $?.to_i.should.instance_of?(Integer) end it "returns an integer when the child is signaled" do ruby_exe('raise SignalException, "TERM"', exit_status: platform_is(:windows) ? 3 : :SIGTERM) - $?.to_i.should be_an_instance_of(Integer) + $?.to_i.should.instance_of?(Integer) end end diff --git a/spec/ruby/core/process/status/wait_spec.rb b/spec/ruby/core/process/status/wait_spec.rb index 57d56209a9..18ecc14f6f 100644 --- a/spec/ruby/core/process/status/wait_spec.rb +++ b/spec/ruby/core/process/status/wait_spec.rb @@ -21,14 +21,14 @@ describe "Process::Status.wait" do it "returns a status with its child pid" do pid = Process.spawn(ruby_cmd('exit')) status = Process::Status.wait - status.should be_an_instance_of(Process::Status) + status.should.instance_of?(Process::Status) status.pid.should == pid end it "should not set $? to the Process::Status" do pid = Process.spawn(ruby_cmd('exit')) status = Process::Status.wait - $?.should_not equal(status) + $?.should_not.equal?(status) end it "should not change the value of $?" do @@ -36,13 +36,13 @@ describe "Process::Status.wait" do Process.wait status = $? Process::Status.wait - status.should equal($?) + status.should.equal?($?) end it "waits for any child process if no pid is given" do pid = Process.spawn(ruby_cmd('exit')) Process::Status.wait.pid.should == pid - -> { Process.kill(0, pid) }.should raise_error(Errno::ESRCH) + -> { Process.kill(0, pid) }.should.raise(Errno::ESRCH) end it "waits for a specific child if a pid is given" do @@ -50,14 +50,14 @@ describe "Process::Status.wait" do pid2 = Process.spawn(ruby_cmd('exit')) Process::Status.wait(pid2).pid.should == pid2 Process::Status.wait(pid1).pid.should == pid1 - -> { Process.kill(0, pid1) }.should raise_error(Errno::ESRCH) - -> { Process.kill(0, pid2) }.should raise_error(Errno::ESRCH) + -> { Process.kill(0, pid1) }.should.raise(Errno::ESRCH) + -> { Process.kill(0, pid2) }.should.raise(Errno::ESRCH) end it "coerces the pid to an Integer" do pid1 = Process.spawn(ruby_cmd('exit')) Process::Status.wait(mock_int(pid1)).pid.should == pid1 - -> { Process.kill(0, pid1) }.should raise_error(Errno::ESRCH) + -> { Process.kill(0, pid1) }.should.raise(Errno::ESRCH) end # This spec is probably system-dependent. @@ -80,7 +80,7 @@ describe "Process::Status.wait" do sleep end - Process::Status.wait(pid, Process::WNOHANG).should be_nil + Process::Status.wait(pid, Process::WNOHANG).should == nil # wait for the child to setup its TERM handler write.close @@ -94,7 +94,7 @@ describe "Process::Status.wait" do it "always accepts flags=0" do pid = Process.spawn(ruby_cmd('exit')) Process::Status.wait(-1, 0).pid.should == pid - -> { Process.kill(0, pid) }.should raise_error(Errno::ESRCH) + -> { Process.kill(0, pid) }.should.raise(Errno::ESRCH) end end end |
