Skip to content

Commit ab4781b

Browse files
committed
1 parent 14fa5e3 commit ab4781b

File tree

88 files changed

+1634
-289
lines changed

Some content is hidden

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

88 files changed

+1634
-289
lines changed

spec/ruby/.rubocop.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ Lint/AssignmentInCondition:
3333
Lint/BooleanSymbol:
3434
Enabled: false
3535

36+
Lint/DeprecatedOpenSSLConstant:
37+
Exclude:
38+
- library/openssl/digest/**/*.rb
39+
3640
Lint/InterpolationCheck:
3741
Enabled: false
3842

spec/ruby/CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ In case there is a bug in MRI and the fix will be backported to previous version
179179
If it is not backported or not likely, use `ruby_version_is` instead.
180180
First, file a bug at https://bugs.ruby-lang.org/.
181181
The problem is `ruby_bug` would make non-MRI implementations fail this spec while MRI itself does not pass it, so it should only be used if the bug is/will be fixed and backported.
182+
Otherwise, non-MRI implementations would have to choose between being incompatible with the latest release of MRI to pass the spec or fail the spec, both which make no sense.
182183

183184
```ruby
184185
ruby_bug '#13669', ''...'3.2' do

spec/ruby/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ MSpec can automatically add new top-level constants in this file with:
128128

129129
$ CHECK_LEAKS=save mspec ../mspec/bin/mspec file
130130

131+
### Running Specs on S390x CPU Architecture
132+
133+
Run the specs with `DFLTCC=0` if you see failing specs related to the zlib library on s390x CPU architecture. The failures can happen with the zlib library applying the patch madler/zlib#410 to enable the deflate algorithm producing a different compressed byte stream.
134+
135+
$ DFLTCC=0 ../mspec/bin/mspec
136+
131137
### Contributing and Writing Specs
132138

133139
See [CONTRIBUTING.md](https://github.com/ruby/spec/blob/master/CONTRIBUTING.md) for documentation about contributing and writing specs (guards, matchers, etc).

spec/ruby/command_line/dash_a_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
end
77

88
it "runs the code in loop conditional on Kernel.gets()" do
9-
ruby_exe("puts $F.last", options: "-n -a", escape: true,
9+
ruby_exe("puts $F.last", options: "-n -a",
1010
args: " < #{@names}").should ==
1111
"jones\nfield\ngrey\n"
1212
end
1313

1414
it "sets $-a" do
15-
ruby_exe("puts $-a", options: "-n -a", escape: true,
15+
ruby_exe("puts $-a", options: "-n -a",
1616
args: " < #{@names}").should ==
1717
"true\ntrue\ntrue\n"
1818
end

spec/ruby/command_line/dash_l_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@
66
end
77

88
it "chomps lines with default separator" do
9-
ruby_exe('puts $_.end_with?("\n")', options: "-n -l", escape: true,
9+
ruby_exe('puts $_.end_with?("\n")', options: "-n -l",
1010
args: " < #{@names}").should ==
1111
"false\nfalse\nfalse\n"
1212
end
1313

1414
it "chomps last line based on $/" do
15-
ruby_exe('BEGIN { $/ = "ones\n" }; puts $_', options: "-W0 -n -l", escape: true,
15+
ruby_exe('BEGIN { $/ = "ones\n" }; puts $_', options: "-W0 -n -l",
1616
args: " < #{@names}").should ==
1717
"alice j\nbob field\njames grey\n"
1818
end
1919

2020
it "sets $\\ to the value of $/" do
21-
ruby_exe("puts $\\ == $/", options: "-W0 -n -l", escape: true,
21+
ruby_exe("puts $\\ == $/", options: "-W0 -n -l",
2222
args: " < #{@names}").should ==
2323
"true\ntrue\ntrue\n"
2424
end
2525

2626
it "sets $-l" do
27-
ruby_exe("puts $-l", options: "-n -l", escape: true,
27+
ruby_exe("puts $-l", options: "-n -l",
2828
args: " < #{@names}").should ==
2929
"true\ntrue\ntrue\n"
3030
end

spec/ruby/command_line/dash_n_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
end
77

88
it "runs the code in loop conditional on Kernel.gets()" do
9-
ruby_exe("puts $_", options: "-n", escape: true,
9+
ruby_exe("puts $_", options: "-n",
1010
args: " < #{@names}").should ==
1111
"alice\nbob\njames\n"
1212
end
1313

1414
it "only evaluates BEGIN blocks once" do
15-
ruby_exe("BEGIN { puts \"hi\" }; puts $_", options: "-n", escape: true,
15+
ruby_exe("BEGIN { puts \"hi\" }; puts $_", options: "-n",
1616
args: " < #{@names}").should ==
1717
"hi\nalice\nbob\njames\n"
1818
end
1919

2020
it "only evaluates END blocks once" do
21-
ruby_exe("puts $_; END {puts \"bye\"}", options: "-n", escape: true,
21+
ruby_exe("puts $_; END {puts \"bye\"}", options: "-n",
2222
args: " < #{@names}").should ==
2323
"alice\nbob\njames\nbye\n"
2424
end
@@ -29,7 +29,7 @@
2929
$total += 1
3030
END { puts $total }
3131
script
32-
ruby_exe(script, options: "-n", escape: true,
32+
ruby_exe(script, options: "-n",
3333
args: " < #{@names}").should ==
3434
"3\n"
3535
end

spec/ruby/command_line/dash_p_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
end
77

88
it "runs the code in loop conditional on Kernel.gets() and prints $_" do
9-
ruby_exe("$_ = $_.upcase", options: "-p", escape: true,
9+
ruby_exe("$_ = $_.upcase", options: "-p",
1010
args: " < #{@names}").should ==
1111
"ALICE\nBOB\nJAMES\n"
1212
end
1313

1414
it "sets $-p" do
15-
ruby_exe("$_ = $-p", options: "-p", escape: true,
15+
ruby_exe("$_ = $-p", options: "-p",
1616
args: " < #{@names}").should ==
1717
"truetruetrue"
1818
end

spec/ruby/command_line/dash_upper_f_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
end
77

88
it "specifies the field separator pattern for -a" do
9-
ruby_exe("puts $F[0]", options: "-naF:", escape: true,
9+
ruby_exe("puts $F[0]", options: "-naF:",
1010
args: " < #{@passwd}").should ==
1111
"nobody\nroot\ndaemon\n"
1212
end

spec/ruby/command_line/rubyopt_spec.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111

1212
it "adds the -I path to $LOAD_PATH" do
1313
ENV["RUBYOPT"] = "-Ioptrubyspecincl"
14-
result = ruby_exe("puts $LOAD_PATH.grep(/byspecin/)", escape: true)
14+
result = ruby_exe("puts $LOAD_PATH.grep(/byspecin/)")
1515
result.chomp[-15..-1].should == "optrubyspecincl"
1616
end
1717

1818
it "sets $DEBUG to true for '-d'" do
1919
ENV["RUBYOPT"] = '-d'
2020
command = %[puts "value of $DEBUG is \#{$DEBUG}"]
21-
result = ruby_exe(command, escape: true, args: "2>&1")
21+
result = ruby_exe(command, args: "2>&1")
2222
result.should =~ /value of \$DEBUG is true/
2323
end
2424

@@ -36,27 +36,27 @@
3636

3737
it "sets $VERBOSE to true for '-w'" do
3838
ENV["RUBYOPT"] = '-w'
39-
ruby_exe("p $VERBOSE", escape: true).chomp.should == "true"
39+
ruby_exe("p $VERBOSE").chomp.should == "true"
4040
end
4141

4242
it "sets $VERBOSE to true for '-W'" do
4343
ENV["RUBYOPT"] = '-W'
44-
ruby_exe("p $VERBOSE", escape: true).chomp.should == "true"
44+
ruby_exe("p $VERBOSE").chomp.should == "true"
4545
end
4646

4747
it "sets $VERBOSE to nil for '-W0'" do
4848
ENV["RUBYOPT"] = '-W0'
49-
ruby_exe("p $VERBOSE", escape: true).chomp.should == "nil"
49+
ruby_exe("p $VERBOSE").chomp.should == "nil"
5050
end
5151

5252
it "sets $VERBOSE to false for '-W1'" do
5353
ENV["RUBYOPT"] = '-W1'
54-
ruby_exe("p $VERBOSE", escape: true).chomp.should == "false"
54+
ruby_exe("p $VERBOSE").chomp.should == "false"
5555
end
5656

5757
it "sets $VERBOSE to true for '-W2'" do
5858
ENV["RUBYOPT"] = '-W2'
59-
ruby_exe("p $VERBOSE", escape: true).chomp.should == "true"
59+
ruby_exe("p $VERBOSE").chomp.should == "true"
6060
end
6161

6262
it "suppresses deprecation warnings for '-W:no-deprecated'" do

spec/ruby/core/argf/readpartial_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
print ARGF.readpartial(#{@stdin.size})
7070
ARGF.readpartial(1) rescue print $!.class
7171
STR
72-
stdin = ruby_exe(ruby_str, args: "< #{@stdin_name}", escape: true)
72+
stdin = ruby_exe(ruby_str, args: "< #{@stdin_name}")
7373
stdin.should == @stdin + "EOFError"
7474
end
7575
end

0 commit comments

Comments
 (0)