Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3270 from rubinius/process-initialize
Changes to make Process::Status compatible with MRI
- Loading branch information
Showing
3 changed files
with
51 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require File.expand_path('../../../spec_helper', __FILE__) | ||
|
||
describe 'Process::Status#exitstatus' do | ||
it 'returns the exit status as a Fixnum' do | ||
Process::Status.new(42, 1).exitstatus.should == 1 | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
require File.expand_path('../../../spec_helper', __FILE__) | ||
|
||
describe 'Process::Status#initialize' do | ||
it 'initializes a new Process::Status instance' do | ||
Process::Status.new.should be_an_instance_of(Process::Status) | ||
end | ||
|
||
it 'initializes Process::Status with a PID' do | ||
status = Process::Status.new(42) | ||
|
||
status.pid.should == 42 | ||
end | ||
|
||
it 'initializes Process::Status with a PID and status' do | ||
status = Process::Status.new(42, 1) | ||
|
||
status.exitstatus.should == 1 | ||
end | ||
|
||
it 'initializes Process::Status with a PID, status and term signal' do | ||
status = Process::Status.new(42, 1, 2) | ||
|
||
status.termsig.should == 2 | ||
end | ||
|
||
it 'initializes Process::Status with a PID, status, term signal and stop signal' do | ||
status = Process::Status.new(42, 1, 2, 3) | ||
|
||
status.stopsig.should == 3 | ||
end | ||
end |