File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
src/main/ruby/truffleruby/core Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 21
21
end
22
22
end
23
23
24
+ it "raises a SystemExit with message 'exit'" do
25
+ -> { @object . exit } . should raise_error ( SystemExit ) { |e |
26
+ e . message . should == "exit"
27
+ }
28
+ end
29
+
24
30
it "tries to convert the passed argument to an Integer using #to_int" do
25
31
obj = mock ( '5' )
26
32
obj . should_receive ( :to_int ) . and_return ( 5 )
Original file line number Diff line number Diff line change @@ -69,8 +69,6 @@ module Constants
69
69
70
70
FFI = Truffle ::FFI
71
71
72
- # Terminate with given status code.
73
- #
74
72
def self . exit ( code = 0 )
75
73
case code
76
74
when true
@@ -81,7 +79,7 @@ def self.exit(code=0)
81
79
code = Truffle ::Type . coerce_to code , Integer , :to_int
82
80
end
83
81
84
- raise SystemExit , code
82
+ raise SystemExit . new ( code , 'exit' )
85
83
end
86
84
87
85
def self . exit! ( code = 1 )
You can’t perform that action at this time.
0 commit comments