Skip to content

Commit b7a4954

Browse files
committed
[GR-14806] Update specs
PullRequest: truffleruby/2842
2 parents 78ee9d9 + 532913e commit b7a4954

File tree

167 files changed

+2681
-3285
lines changed

Some content is hidden

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

167 files changed

+2681
-3285
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ jobs:
192192
strategy:
193193
fail-fast: false
194194
matrix:
195-
ruby: [2.5, 2.6, 2.7]
195+
ruby: [2.6, 2.7, 3.0]
196196
runs-on: ubuntu-latest
197197
steps:
198198
- uses: actions/checkout@v2

ci.jsonnet

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ local part_definitions = {
311311
"CHECK_LEAKS": "true",
312312
},
313313
run+: jt(["-u", mri_path(mri_version), "mspec", "spec/ruby"]) +
314-
jt(["-u", mri_path("2.5.7"), "mspec", "spec/ruby"]),
314+
jt(["-u", mri_path("2.6.6"), "mspec", "spec/ruby"]),
315315
},
316316

317317
test_fast: {
@@ -490,8 +490,8 @@ local composition_environment = utils.add_inclusion_tracking(part_definitions, "
490490
local native_tests = $.run.testdownstream_aot + $.run.test_integration + $.run.test_compiler,
491491

492492
// Order: platform, jdk, mx_env. Keep aligned for an easy visual comparison.
493-
"ruby-test-specs-linux-8": $.platform.linux + $.jdk.v8 + $.env.jvm + gate_no_build + $.use.build + $.run.test_unit_tck + native_config + $.run.test_specs + { timelimit: "01:15:00" },
494-
"ruby-test-specs-linux-11": $.platform.linux + $.jdk.v11 + $.env.jvm + gate_no_build + $.use.build + $.run.test_unit_tck + native_config + $.run.test_specs + { timelimit: "01:15:00" },
493+
"ruby-test-specs-linux-8": $.platform.linux + $.jdk.v8 + $.env.jvm + gate_no_build + $.use.build + $.run.test_unit_tck + native_config + $.run.test_specs + { timelimit: "01:20:00" },
494+
"ruby-test-specs-linux-11": $.platform.linux + $.jdk.v11 + $.env.jvm + gate_no_build + $.use.build + $.run.test_unit_tck + native_config + $.run.test_specs + { timelimit: "01:20:00" },
495495
"ruby-test-specs-darwin-8": $.platform.darwin + $.jdk.v8 + $.env.jvm + gate_no_build + $.use.build + $.run.test_unit_tck + native_config + $.run.test_specs + { timelimit: "01:40:00" },
496496
"ruby-test-specs-darwin-11": $.platform.darwin + $.jdk.v11 + $.env.jvm + gate_no_build + $.use.build + $.run.test_unit_tck + native_config + $.run.test_specs + { timelimit: "01:40:00" },
497497
"ruby-test-fast-linux-arm64": $.platform.linux_arm64 + $.jdk.v11 + $.env.jvm + gate + $.run.test_fast + native_config + { timelimit: "45:00" },

spec/mspec/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ specs in a manner compatible with multiple Ruby implementations.
3636

3737
## Requirements
3838

39-
MSpec requires Ruby 2.5 or more recent.
39+
MSpec requires Ruby 2.6 or more recent.
4040

4141
## Bundler
4242

spec/mspec/lib/mspec/utils/script.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,8 @@ def self.main
280280
end
281281

282282
private def check_version!
283-
ruby_version_is ""..."2.5" do
284-
warn "MSpec is supported for Ruby 2.5 and above only"
283+
ruby_version_is ""..."2.6" do
284+
warn "MSpec is supported for Ruby 2.6 and above only"
285285
end
286286
end
287287
end

spec/ruby/.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
inherit_from: .rubocop_todo.yml
22

33
AllCops:
4-
TargetRubyVersion: 2.5
4+
TargetRubyVersion: 2.6
55
DisplayCopNames: true
66
Exclude:
77
- command_line/fixtures/bad_syntax.rb

spec/ruby/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ First, file a bug at https://bugs.ruby-lang.org/.
178178
It is better to use a `ruby_version_is` guard if there was a release with the fix.
179179

180180
```ruby
181-
ruby_bug '#13669', ''...'2.5' do
181+
ruby_bug '#13669', ''...'2.7' do
182182
it "works like this" do
183183
# Specify the expected behavior here, not the bug
184184
end

spec/ruby/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ ruby/spec is known to be tested in these implementations for every commit:
2929
* [TruffleRuby](https://github.com/oracle/truffleruby/tree/master/spec/ruby)
3030
* [Opal](https://github.com/opal/opal/tree/master/spec)
3131

32-
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://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.
32+
ruby/spec describes the behavior of Ruby 2.6 and more recent Ruby versions.
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.6.x, 2.7.x, 3.0.x, etc), and those are tested in CI.
3434

3535
### Synchronization with Ruby Implementations
3636

@@ -57,6 +57,7 @@ For older specs try these commits:
5757
* Ruby 2.2.10 - [Suite](https://github.com/ruby/spec/commit/cbaa0e412270c944df0c2532fc500c920dba0e92) using [MSpec](https://github.com/ruby/mspec/commit/d84d7668449e96856c5f6bac8cb1526b6d357ce3)
5858
* Ruby 2.3.8 - [Suite](https://github.com/ruby/spec/commit/dc733114d8ae66a3368ba3a98422c50147a76ba5) using [MSpec](https://github.com/ruby/mspec/commit/4599bc195fb109f2a482a01c32a7d659518369ea)
5959
* Ruby 2.4.10 - [Suite](https://github.com/ruby/spec/commit/bce4f2b81d6c31db67cf4d023a0625ceadde59bd) using [MSpec](https://github.com/ruby/mspec/commit/e7eb8aa4c26495b7b461e687d950b96eb08b3ff2)
60+
* Ruby 2.5.9 - [Suite](https://github.com/ruby/spec/commit/c503335d3d9f6ec6ef24de60a0716c34af69b64f) using [MSpec](https://github.com/ruby/mspec/commit/0091e8a62e954717cd54641f935eaf1403692041)
6061

6162
### Running the specs
6263

spec/ruby/command_line/dash_upper_w_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
end
3838

3939
ruby_version_is "3.0" do
40-
@src = '[0, 1] => [a, b]'
40+
@src = 'warn "This is experimental warning.", category: :experimental'
4141
end
4242
end
4343

spec/ruby/command_line/feature_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Since some specs disable reading RUBYOPT, we instead pass its contents as :options for those specs
66
rubyopt = [ENV["RUBYOPT"]]
77
rubyopt << ENV["#{RUBY_ENGINE.upcase}OPT"] unless RUBY_ENGINE == 'ruby'
8-
@rubyopt = rubyopt.compact.join(" ")
8+
@rubyopt = RUBY_ENGINE == "ruby" ? "" : rubyopt.compact.join(" ")
99
end
1010

1111
it "can be used with gems" do

spec/ruby/core/array/difference_spec.rb

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,21 @@
22
require_relative 'fixtures/classes'
33
require_relative 'shared/difference'
44

5-
ruby_version_is "2.6" do
6-
describe "Array#difference" do
7-
it_behaves_like :array_binary_difference, :difference
5+
describe "Array#difference" do
6+
it_behaves_like :array_binary_difference, :difference
87

9-
it "returns a copy when called without any parameter" do
10-
x = [1, 2, 3, 2]
11-
x.difference.should == x
12-
x.difference.should_not equal x
13-
end
8+
it "returns a copy when called without any parameter" do
9+
x = [1, 2, 3, 2]
10+
x.difference.should == x
11+
x.difference.should_not equal x
12+
end
1413

15-
it "does not return subclass instances for Array subclasses" do
16-
ArraySpecs::MyArray[1, 2, 3].difference.should be_an_instance_of(Array)
17-
end
14+
it "does not return subclass instances for Array subclasses" do
15+
ArraySpecs::MyArray[1, 2, 3].difference.should be_an_instance_of(Array)
16+
end
1817

19-
it "accepts multiple arguments" do
20-
x = [1, 2, 3, 1]
21-
x.difference([], [0, 1], [3, 4], [3]).should == [2]
22-
end
18+
it "accepts multiple arguments" do
19+
x = [1, 2, 3, 1]
20+
x.difference([], [0, 1], [3, 4], [3]).should == [2]
2321
end
2422
end

0 commit comments

Comments
 (0)