Skip to content

Commit f6fead7

Browse files
committed
1 parent e81c5b2 commit f6fead7

File tree

214 files changed

+4778
-4140
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

214 files changed

+4778
-4140
lines changed

spec/ruby/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ ruby/spec is known to be tested in these implementations for every commit:
3030
* [Opal](https://github.com/opal/opal/tree/master/spec)
3131

3232
ruby/spec describes the behavior of Ruby 2.5 and more recent Ruby versions.
33-
More precisely, every latest stable MRI release should [pass](https://travis-ci.org/ruby/spec) all specs of ruby/spec (2.5.x, 2.6.x, 2.7.x, etc), and those are tested in TravisCI.
33+
More precisely, every latest stable MRI release should [pass](https://github.com/ruby/spec/actions/workflows/ci.yml) all specs of ruby/spec (2.5.x, 2.6.x, 2.7.x, etc), and those are tested in CI.
3434

3535
### Synchronization with Ruby Implementations
3636

spec/ruby/command_line/dash_encoding_spec.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
end
2626

2727
it "does not accept a third encoding" do
28-
ruby_exe(@test_string, options: "--disable-gems --encoding big5:#{@enc2}:utf-32le", args: "2>&1").should =~ /extra argument for --encoding: utf-32le/
28+
options = {
29+
options: "--disable-gems --encoding big5:#{@enc2}:utf-32le",
30+
args: "2>&1",
31+
exit_status: 1
32+
}
33+
34+
ruby_exe(@test_string, options).should =~ /extra argument for --encoding: utf-32le/
2935
end
3036
end

spec/ruby/command_line/dash_r_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
end
1414

1515
it "requires the file before parsing the main script" do
16-
out = ruby_exe(fixture(__FILE__, "bad_syntax.rb"), options: "-r #{@test_file}", args: "2>&1")
16+
out = ruby_exe(fixture(__FILE__, "bad_syntax.rb"), options: "-r #{@test_file}", args: "2>&1", exit_status: 1)
1717
$?.should_not.success?
1818
out.should include("REQUIRED")
1919
out.should include("syntax error")

spec/ruby/command_line/dash_upper_e_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
it "raises a RuntimeError if used with -U" do
3232
ruby_exe("p 1",
3333
options: '-Eascii:ascii -U',
34-
args: '2>&1').should =~ /RuntimeError/
34+
args: '2>&1',
35+
exit_status: 1).should =~ /RuntimeError/
3536
end
3637
end

spec/ruby/command_line/dash_upper_s_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
end
2222

2323
it "runs launcher found in PATH and sets the exit status to 1 if it fails" do
24-
result = ruby_exe(nil, options: '-S dash_s_fail', env: { 'PATH' => @path }, args: '2>&1')
24+
result = ruby_exe(nil, options: '-S dash_s_fail', env: { 'PATH' => @path }, args: '2>&1', exit_status: 1)
2525
result.should =~ /\bdie\b/
2626
$?.exitstatus.should == 1
2727
end

spec/ruby/command_line/dash_upper_u_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,14 @@
3232
it "raises a RuntimeError if used with -Eext:int" do
3333
ruby_exe("p 1",
3434
options: '-U -Eascii:ascii',
35-
args: '2>&1').should =~ /RuntimeError/
35+
args: '2>&1',
36+
exit_status: 1).should =~ /RuntimeError/
3637
end
3738

3839
it "raises a RuntimeError if used with -E:int" do
3940
ruby_exe("p 1",
4041
options: '-U -E:ascii',
41-
args: '2>&1').should =~ /RuntimeError/
42+
args: '2>&1',
43+
exit_status: 1).should =~ /RuntimeError/
4244
end
4345
end

spec/ruby/command_line/dash_x_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
it "fails when /\#!.*ruby.*/-ish line in target file is not found" do
1111
bad_embedded_ruby = fixture __FILE__, "bin/bad_embedded_ruby.txt"
12-
result = ruby_exe(bad_embedded_ruby, options: '-x', args: '2>&1')
12+
result = ruby_exe(bad_embedded_ruby, options: '-x', args: '2>&1', exit_status: 1)
1313
result.should include "no Ruby script found in input"
1414
end
1515

spec/ruby/command_line/error_message_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
describe "The error message caused by an exception" do
44
it "is not printed to stdout" do
5-
out = ruby_exe("this_does_not_exist", args: "2> #{File::NULL}")
5+
out = ruby_exe("this_does_not_exist", args: "2> #{File::NULL}", exit_status: 1)
66
out.chomp.should.empty?
77

8-
out = ruby_exe("end #syntax error", args: "2> #{File::NULL}")
8+
out = ruby_exe("end #syntax error", args: "2> #{File::NULL}", exit_status: 1)
99
out.chomp.should.empty?
1010
end
1111
end

spec/ruby/command_line/rubyopt_spec.rb

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -87,101 +87,101 @@
8787

8888
it "raises a RuntimeError for '-a'" do
8989
ENV["RUBYOPT"] = '-a'
90-
ruby_exe("", args: '2>&1').should =~ /RuntimeError/
90+
ruby_exe("", args: '2>&1', exit_status: 1).should =~ /RuntimeError/
9191
end
9292

9393
it "raises a RuntimeError for '-p'" do
9494
ENV["RUBYOPT"] = '-p'
95-
ruby_exe("", args: '2>&1').should =~ /RuntimeError/
95+
ruby_exe("", args: '2>&1', exit_status: 1).should =~ /RuntimeError/
9696
end
9797

9898
it "raises a RuntimeError for '-n'" do
9999
ENV["RUBYOPT"] = '-n'
100-
ruby_exe("", args: '2>&1').should =~ /RuntimeError/
100+
ruby_exe("", args: '2>&1', exit_status: 1).should =~ /RuntimeError/
101101
end
102102

103103
it "raises a RuntimeError for '-y'" do
104104
ENV["RUBYOPT"] = '-y'
105-
ruby_exe("", args: '2>&1').should =~ /RuntimeError/
105+
ruby_exe("", args: '2>&1', exit_status: 1).should =~ /RuntimeError/
106106
end
107107

108108
it "raises a RuntimeError for '-c'" do
109109
ENV["RUBYOPT"] = '-c'
110-
ruby_exe("", args: '2>&1').should =~ /RuntimeError/
110+
ruby_exe("", args: '2>&1', exit_status: 1).should =~ /RuntimeError/
111111
end
112112

113113
it "raises a RuntimeError for '-s'" do
114114
ENV["RUBYOPT"] = '-s'
115-
ruby_exe("", args: '2>&1').should =~ /RuntimeError/
115+
ruby_exe("", args: '2>&1', exit_status: 1).should =~ /RuntimeError/
116116
end
117117

118118
it "raises a RuntimeError for '-h'" do
119119
ENV["RUBYOPT"] = '-h'
120-
ruby_exe("", args: '2>&1').should =~ /RuntimeError/
120+
ruby_exe("", args: '2>&1', exit_status: 1).should =~ /RuntimeError/
121121
end
122122

123123
it "raises a RuntimeError for '--help'" do
124124
ENV["RUBYOPT"] = '--help'
125-
ruby_exe("", args: '2>&1').should =~ /RuntimeError/
125+
ruby_exe("", args: '2>&1', exit_status: 1).should =~ /RuntimeError/
126126
end
127127

128128
it "raises a RuntimeError for '-l'" do
129129
ENV["RUBYOPT"] = '-l'
130-
ruby_exe("", args: '2>&1').should =~ /RuntimeError/
130+
ruby_exe("", args: '2>&1', exit_status: 1).should =~ /RuntimeError/
131131
end
132132

133133
it "raises a RuntimeError for '-S'" do
134134
ENV["RUBYOPT"] = '-S irb'
135-
ruby_exe("", args: '2>&1').should =~ /RuntimeError/
135+
ruby_exe("", args: '2>&1', exit_status: 1).should =~ /RuntimeError/
136136
end
137137

138138
it "raises a RuntimeError for '-e'" do
139139
ENV["RUBYOPT"] = '-e0'
140-
ruby_exe("", args: '2>&1').should =~ /RuntimeError/
140+
ruby_exe("", args: '2>&1', exit_status: 1).should =~ /RuntimeError/
141141
end
142142

143143
it "raises a RuntimeError for '-i'" do
144144
ENV["RUBYOPT"] = '-i.bak'
145-
ruby_exe("", args: '2>&1').should =~ /RuntimeError/
145+
ruby_exe("", args: '2>&1', exit_status: 1).should =~ /RuntimeError/
146146
end
147147

148148
it "raises a RuntimeError for '-x'" do
149149
ENV["RUBYOPT"] = '-x'
150-
ruby_exe("", args: '2>&1').should =~ /RuntimeError/
150+
ruby_exe("", args: '2>&1', exit_status: 1).should =~ /RuntimeError/
151151
end
152152

153153
it "raises a RuntimeError for '-C'" do
154154
ENV["RUBYOPT"] = '-C'
155-
ruby_exe("", args: '2>&1').should =~ /RuntimeError/
155+
ruby_exe("", args: '2>&1', exit_status: 1).should =~ /RuntimeError/
156156
end
157157

158158
it "raises a RuntimeError for '-X'" do
159159
ENV["RUBYOPT"] = '-X.'
160-
ruby_exe("", args: '2>&1').should =~ /RuntimeError/
160+
ruby_exe("", args: '2>&1', exit_status: 1).should =~ /RuntimeError/
161161
end
162162

163163
it "raises a RuntimeError for '-F'" do
164164
ENV["RUBYOPT"] = '-F'
165-
ruby_exe("", args: '2>&1').should =~ /RuntimeError/
165+
ruby_exe("", args: '2>&1', exit_status: 1).should =~ /RuntimeError/
166166
end
167167

168168
it "raises a RuntimeError for '-0'" do
169169
ENV["RUBYOPT"] = '-0'
170-
ruby_exe("", args: '2>&1').should =~ /RuntimeError/
170+
ruby_exe("", args: '2>&1', exit_status: 1).should =~ /RuntimeError/
171171
end
172172

173173
it "raises a RuntimeError for '--copyright'" do
174174
ENV["RUBYOPT"] = '--copyright'
175-
ruby_exe("", args: '2>&1').should =~ /RuntimeError/
175+
ruby_exe("", args: '2>&1', exit_status: 1).should =~ /RuntimeError/
176176
end
177177

178178
it "raises a RuntimeError for '--version'" do
179179
ENV["RUBYOPT"] = '--version'
180-
ruby_exe("", args: '2>&1').should =~ /RuntimeError/
180+
ruby_exe("", args: '2>&1', exit_status: 1).should =~ /RuntimeError/
181181
end
182182

183183
it "raises a RuntimeError for '--yydebug'" do
184184
ENV["RUBYOPT"] = '--yydebug'
185-
ruby_exe("", args: '2>&1').should =~ /RuntimeError/
185+
ruby_exe("", args: '2>&1', exit_status: 1).should =~ /RuntimeError/
186186
end
187187
end

spec/ruby/command_line/syntax_error_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
describe "The interpreter" do
44
it "prints an error when given a file with invalid syntax" do
5-
out = ruby_exe(fixture(__FILE__, "bad_syntax.rb"), args: "2>&1")
5+
out = ruby_exe(fixture(__FILE__, "bad_syntax.rb"), args: "2>&1", exit_status: 1)
66
out.should include "syntax error"
77
end
88

99
it "prints an error when given code via -e with invalid syntax" do
10-
out = ruby_exe(nil, args: "-e 'a{' 2>&1")
10+
out = ruby_exe(nil, args: "-e 'a{' 2>&1", exit_status: 1)
1111
out.should include "syntax error"
1212
end
1313
end

0 commit comments

Comments
 (0)