Skip to content

Commit 02b0649

Browse files
committed
1 parent 0045cbf commit 02b0649

File tree

219 files changed

+4819
-4224
lines changed

Some content is hidden

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

219 files changed

+4819
-4224
lines changed

spec/ruby/.rubocop.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ Lint/InterpolationCheck:
4343
Lint/LiteralAsCondition:
4444
Enabled: false
4545

46-
Lint/RedundantRequireStatement:
47-
Enabled: false
48-
4946
Lint/RedundantSplatExpansion:
5047
Enabled: false
5148

@@ -106,6 +103,9 @@ Lint/OutOfRangeRegexpRef:
106103
Lint/InheritException:
107104
Enabled: false
108105

106+
Lint/SafeNavigationChain:
107+
Enabled: false
108+
109109
Lint/ElseLayout:
110110
Exclude:
111111
- 'language/if_spec.rb'

spec/ruby/command_line/dash_v_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
it "prints version and ends" do
99
ruby_exe(nil, args: '-v').should include(RUBY_DESCRIPTION)
1010
end unless (defined?(RubyVM::YJIT) && RubyVM::YJIT.enabled?) ||
11-
(defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled?)
11+
(defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled?) ||
12+
(ENV['RUBY_MN_THREADS'] == '1')
1213
end
1314
end

spec/ruby/core/array/rassoc_spec.rb

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,17 @@ def o.==(other); other == 'foobar'; end
3636
[[1, :foobar, o], [2, o, 1], [3, mock('foo')]].rassoc(key).should == [2, o, 1]
3737
end
3838

39-
it "does not call to_ary on non-array elements" do
40-
s1 = [1, 2]
41-
s2 = ArraySpecs::ArrayConvertible.new(2, 3)
42-
a = [s1, s2]
43-
44-
s1.should_not_receive(:to_ary)
45-
a.rassoc(2).should equal(s1)
46-
47-
s2.should_not_receive(:to_ary)
48-
a.rassoc(3).should equal(nil)
39+
ruby_version_is "3.3" do
40+
it "calls to_ary on non-array elements" do
41+
s1 = [1, 2]
42+
s2 = ArraySpecs::ArrayConvertible.new(2, 3)
43+
a = [s1, s2]
44+
45+
s1.should_not_receive(:to_ary)
46+
a.rassoc(2).should equal(s1)
47+
48+
a.rassoc(3).should == [2, 3]
49+
s2.called.should equal(:to_ary)
50+
end
4951
end
5052
end

spec/ruby/core/conditionvariable/broadcast_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
require_relative '../../spec_helper'
2-
require 'thread'
32

43
describe "ConditionVariable#broadcast" do
54
it "releases all threads waiting in line for this resource" do

spec/ruby/core/conditionvariable/marshal_dump_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
require_relative '../../spec_helper'
2-
require 'thread'
32

43
describe "ConditionVariable#marshal_dump" do
54
it "raises a TypeError" do

spec/ruby/core/conditionvariable/signal_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
require_relative '../../spec_helper'
2-
require 'thread'
32

43
describe "ConditionVariable#signal" do
54
it "releases the first thread waiting in line for this resource" do

spec/ruby/core/conditionvariable/wait_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
require_relative '../../spec_helper'
2-
require 'thread'
32

43
describe "ConditionVariable#wait" do
54
it "calls #sleep on the given object" do

spec/ruby/core/exception/frozen_error_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ def object.modify; @a = 2 end
3535
-> { object.modify }.should raise_error(FrozenError, /can't modify frozen .*?: \s*.../)
3636
end
3737
end
38-
end
38+
end

spec/ruby/core/file/atime_spec.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
else
2828
File.atime(__FILE__).usec.should == 0
2929
end
30+
rescue Errno::ENOENT => e
31+
# Native Windows don't have stat command.
32+
skip e.message
3033
end
3134
end
3235
end

spec/ruby/core/file/ctime_spec.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
else
2323
File.ctime(__FILE__).usec.should == 0
2424
end
25+
rescue Errno::ENOENT => e
26+
# Windows don't have stat command.
27+
skip e.message
2528
end
2629
end
2730

0 commit comments

Comments
 (0)