summaryrefslogtreecommitdiff
path: root/spec/ruby/core/process/status/equal_value_spec.rb
blob: d85bb22214c8e78df53676546111fc3eb3a790ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require_relative '../../../spec_helper'

describe "Process::Status#==" do
  it "returns true when compared to the integer status of an exited child" do
    ruby_exe("exit(29)", exit_status: 29)
    $?.to_i.should == $?
    $?.should == $?.to_i
  end

  it "returns true when compared to the integer status of a terminated child" do
    ruby_exe("Process.kill(:KILL, $$); exit(29)", exit_status: platform_is(:windows) ? 0 : nil)
    $?.to_i.should == $?
    $?.should == $?.to_i
  end
end