Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion command_line/dash_0_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
ruby_exe("puts $/, $-0", options: "-072").should == ":\n:\n"
end

ruby_version_is "3.5" do
ruby_version_is "4.0" do
it "sets $/ and $-0 as a frozen string" do
ruby_exe("puts $/.frozen?, $-0.frozen?", options: "-072").should == "true\ntrue\n"
end
Expand Down
4 changes: 2 additions & 2 deletions core/enumerable/to_set_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[1, 2, 3].to_set { |x| x * x }.should == Set[1, 4, 9]
end

ruby_version_is "3.5" do
ruby_version_is "4.0" do
it "instantiates an object of provided as the first argument set class" do
set = nil
proc{set = [1, 2, 3].to_set(EnumerableSpecs::SetSubclass)}.should complain(/Enumerable#to_set/)
Expand All @@ -20,7 +20,7 @@
end
end

ruby_version_is ""..."3.5" do
ruby_version_is ""..."4.0" do
it "instantiates an object of provided as the first argument set class" do
set = [1, 2, 3].to_set(EnumerableSpecs::SetSubclass)
set.should be_kind_of(EnumerableSpecs::SetSubclass)
Expand Down
2 changes: 1 addition & 1 deletion core/file/stat/birthtime_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require_relative '../../../spec_helper'

platform_is(:windows, :darwin, :freebsd, :netbsd,
*ruby_version_is("3.5") { :linux },
*ruby_version_is("4.0") { :linux },
) do
not_implemented_messages = [
"birthtime() function is unimplemented", # unsupported OS/version
Expand Down
4 changes: 2 additions & 2 deletions core/kernel/caller_locations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
end
end

ruby_version_is "3.4"..."3.5" do
ruby_version_is "3.4"..."4.0" do
it "includes core library methods defined in Ruby" do
file, line = Kernel.instance_method(:tap).source_location
file.should.start_with?('<internal:')
Expand All @@ -95,7 +95,7 @@
end
end

ruby_version_is "3.5" do
ruby_version_is "4.0" do
it "does not include core library methods defined in Ruby" do
file, line = Kernel.instance_method(:tap).source_location
file.should.start_with?('<internal:')
Expand Down
4 changes: 2 additions & 2 deletions core/kernel/caller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
end

guard -> { Kernel.instance_method(:tap).source_location } do
ruby_version_is ""..."3.5" do
ruby_version_is ""..."4.0" do
it "includes core library methods defined in Ruby" do
file, line = Kernel.instance_method(:tap).source_location
file.should.start_with?('<internal:')
Expand All @@ -95,7 +95,7 @@
end
end

ruby_version_is "3.5" do
ruby_version_is "4.0" do
it "includes core library methods defined in Ruby" do
file, line = Kernel.instance_method(:tap).source_location
file.should.start_with?('<internal:')
Expand Down
2 changes: 1 addition & 1 deletion core/kernel/inspect_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class << obj
obj.inspect.should be_kind_of(String)
end

ruby_version_is "3.5" do
ruby_version_is "4.0" do
it "calls #instance_variables_to_inspect private method to know which variables to display" do
obj = Object.new
obj.instance_eval do
Expand Down
4 changes: 2 additions & 2 deletions core/kernel/require_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
end

provided = %w[complex enumerator fiber rational thread ruby2_keywords]
ruby_version_is "3.5" do
ruby_version_is "4.0" do
provided << "set"
provided << "pathname"
end
Expand All @@ -32,7 +32,7 @@

features.sort.should == provided.sort

ruby_version_is "3.5" do
ruby_version_is "4.0" do
provided.map! { |f| f == "pathname" ? "pathname.so" : f }
end

Expand Down
6 changes: 3 additions & 3 deletions core/marshal/dump_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def _dump(level)
Marshal.dump(MarshalSpec::ClassWithOverriddenName).should == "\x04\bc)MarshalSpec::ClassWithOverriddenName"
end

ruby_version_is "3.5" do
ruby_version_is "4.0" do
it "dumps a class with multibyte characters in name" do
source_object = eval("MarshalSpec::MultibyteぁあぃいClass".dup.force_encoding(Encoding::UTF_8))
Marshal.dump(source_object).should == "\x04\bIc,MarshalSpec::Multibyte\xE3\x81\x81\xE3\x81\x82\xE3\x81\x83\xE3\x81\x84Class\x06:\x06ET"
Expand Down Expand Up @@ -261,7 +261,7 @@ def _dump(level)
Marshal.dump(MarshalSpec::ModuleWithOverriddenName).should == "\x04\bc*MarshalSpec::ModuleWithOverriddenName"
end

ruby_version_is "3.5" do
ruby_version_is "4.0" do
it "dumps a module with multibyte characters in name" do
source_object = eval("MarshalSpec::MultibyteけげこごModule".dup.force_encoding(Encoding::UTF_8))
Marshal.dump(source_object).should == "\x04\bIm-MarshalSpec::Multibyte\xE3\x81\x91\xE3\x81\x92\xE3\x81\x93\xE3\x81\x94Module\x06:\x06ET"
Expand Down Expand Up @@ -880,7 +880,7 @@ def finalizer.noop(_)
Marshal.dump(obj).should include("MarshalSpec::TimeWithOverriddenName")
end

ruby_version_is "3.5" do
ruby_version_is "4.0" do
it "dumps a Time subclass with multibyte characters in name" do
source_object = eval("MarshalSpec::MultibyteぁあぃいTime".dup.force_encoding(Encoding::UTF_8))
Marshal.dump(source_object).should == "\x04\bIc+MarshalSpec::Multibyte\xE3\x81\x81\xE3\x81\x82\xE3\x81\x83\xE3\x81\x84Time\x06:\x06ET"
Expand Down
4 changes: 2 additions & 2 deletions core/method/source_location_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ def f
eval('def self.m; end', nil, "foo", 100)
end
location = c.method(:m).source_location
ruby_version_is(""..."3.5") do
ruby_version_is(""..."4.0") do
location.should == ["foo", 100]
end
ruby_version_is("3.5") do
ruby_version_is("4.0") do
location.should == ["foo", 100, 0, 100, 15]
end
end
Expand Down
2 changes: 1 addition & 1 deletion core/module/ruby2_keywords_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def obj.foo(*a, **b) end
}.should complain(/Skipping set of ruby2_keywords flag for/)
end

ruby_version_is "3.5" do
ruby_version_is "4.0" do
it "prints warning when a method accepts post arguments" do
obj = Object.new
def obj.foo(*a, b) end
Expand Down
2 changes: 1 addition & 1 deletion core/module/set_temporary_name_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ module m::N; end
m.name.should == "fake_name_2"
end

ruby_bug "#21094", ""..."3.5" do
ruby_bug "#21094", ""..."4.0" do
it "also updates a name of a nested module" do
m = Module.new
m::N = Module.new
Expand Down
4 changes: 2 additions & 2 deletions core/objectspace/_id2ref_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require_relative '../../spec_helper'

ruby_version_is "3.5" do
ruby_version_is "4.0" do
describe "ObjectSpace._id2ref" do
it "is deprecated" do
id = nil.object_id
Expand All @@ -11,7 +11,7 @@
end
end

ruby_version_is ""..."3.5" do
ruby_version_is ""..."4.0" do
describe "ObjectSpace._id2ref" do
it "converts an object id to a reference to the object" do
s = "I am a string"
Expand Down
2 changes: 1 addition & 1 deletion core/proc/ruby2_keywords_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
}.should complain(/Skipping set of ruby2_keywords flag for/)
end

ruby_version_is "3.5" do
ruby_version_is "4.0" do
it "prints warning when a proc accepts post arguments" do
f = -> *a, b { }

Expand Down
8 changes: 4 additions & 4 deletions core/proc/source_location_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@
end

it "works even if the proc was created on the same line" do
ruby_version_is(""..."3.5") do
ruby_version_is(""..."4.0") do
proc { true }.source_location.should == [__FILE__, __LINE__]
Proc.new { true }.source_location.should == [__FILE__, __LINE__]
-> { true }.source_location.should == [__FILE__, __LINE__]
end
ruby_version_is("3.5") do
ruby_version_is("4.0") do
proc { true }.source_location.should == [__FILE__, __LINE__, 11, __LINE__, 19]
Proc.new { true }.source_location.should == [__FILE__, __LINE__, 15, __LINE__, 23]
-> { true }.source_location.should == [__FILE__, __LINE__, 8, __LINE__, 17]
Expand Down Expand Up @@ -94,10 +94,10 @@
it "works for eval with a given line" do
proc = eval('-> {}', nil, "foo", 100)
location = proc.source_location
ruby_version_is(""..."3.5") do
ruby_version_is(""..."4.0") do
location.should == ["foo", 100]
end
ruby_version_is("3.5") do
ruby_version_is("4.0") do
location.should == ["foo", 100, 2, 100, 5]
end
end
Expand Down
4 changes: 2 additions & 2 deletions core/process/status/bit_and_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require_relative '../../../spec_helper'

ruby_version_is ""..."3.5" do
ruby_version_is ""..."4.0" do

describe "Process::Status#&" do
it "returns a bitwise and of the integer status of an exited child" do
Expand All @@ -17,7 +17,7 @@
end
end

ruby_version_is "3.3"..."3.5" do
ruby_version_is "3.3"..."4.0" do
it "raises an ArgumentError if mask is negative" do
suppress_warning do
ruby_exe("exit(0)")
Expand Down
4 changes: 2 additions & 2 deletions core/process/status/right_shift_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require_relative '../../../spec_helper'

ruby_version_is ""..."3.5" do
ruby_version_is ""..."4.0" do

describe "Process::Status#>>" do
it "returns a right shift of the integer status of an exited child" do
Expand All @@ -16,7 +16,7 @@
end
end

ruby_version_is "3.3"..."3.5" do
ruby_version_is "3.3"..."4.0" do
it "raises an ArgumentError if shift value is negative" do
suppress_warning do
ruby_exe("exit(0)")
Expand Down
4 changes: 2 additions & 2 deletions core/range/max_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@
(..1.0).max.should == 1.0
end

ruby_version_is ""..."3.5" do
ruby_version_is ""..."4.0" do
it "raises for an exclusive beginless Integer range" do
-> {
(...1).max
}.should raise_error(TypeError, 'cannot exclude end value with non Integer begin value')
end
end

ruby_version_is "3.5" do
ruby_version_is "4.0" do
it "returns the end point for exclusive beginless Integer ranges" do
(...1).max.should == 0
end
Expand Down
2 changes: 1 addition & 1 deletion core/range/reverse_each_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
(1..3).reverse_each.size.should == 3
end

ruby_bug "#20936", "3.4"..."3.5" do
ruby_bug "#20936", "3.4"..."4.0" do
it "returns Infinity when Range size is infinite" do
(..3).reverse_each.size.should == Float::INFINITY
end
Expand Down
4 changes: 2 additions & 2 deletions core/set/compare_by_identity_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def o.hash; 123; end
set.to_a.sort.should == [a1, a2].sort
end

ruby_version_is "3.5" do
ruby_version_is "4.0" do
it "raises a FrozenError on frozen sets" do
set = Set.new.freeze
-> {
Expand All @@ -99,7 +99,7 @@ def o.hash; 123; end
end
end

ruby_version_is ""..."3.5" do
ruby_version_is ""..."4.0" do
it "raises a FrozenError on frozen sets" do
set = Set.new.freeze
-> {
Expand Down
4 changes: 2 additions & 2 deletions core/set/divide_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
set.map{ |x| x.to_a.sort }.sort.should == [[1], [3, 4], [6], [9, 10, 11]]
end

ruby_version_is "3.5" do
ruby_version_is "4.0" do
it "yields each two Object to the block" do
ret = []
Set[1, 2].divide { |x, y| ret << [x, y] }
ret.sort.should == [[1, 2], [2, 1]]
end
end

ruby_version_is ""..."3.5" do
ruby_version_is ""..."4.0" do
it "yields each two Object to the block" do
ret = []
Set[1, 2].divide { |x, y| ret << [x, y] }
Expand Down
2 changes: 1 addition & 1 deletion core/set/equal_value_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
set1.should == set2
end

ruby_version_is ""..."3.5" do
ruby_version_is ""..."4.0" do
context "when comparing to a Set-like object" do
it "returns true when a Set and a Set-like object contain the same elements" do
Set[1, 2, 3].should == SetSpecs::SetLike.new([1, 2, 3])
Expand Down
2 changes: 1 addition & 1 deletion core/set/flatten_merge_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require_relative '../../spec_helper'

describe "Set#flatten_merge" do
ruby_version_is ""..."3.5" do
ruby_version_is ""..."4.0" do
it "is protected" do
Set.should have_protected_instance_method("flatten_merge")
end
Expand Down
4 changes: 2 additions & 2 deletions core/set/flatten_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
-> { set.flatten }.should raise_error(ArgumentError)
end

ruby_version_is ""..."3.5" do
ruby_version_is ""..."4.0" do
context "when Set contains a Set-like object" do
it "returns a copy of self with each included Set-like object flattened" do
Set[SetSpecs::SetLike.new([1])].flatten.should == Set[1]
Expand Down Expand Up @@ -48,7 +48,7 @@
end

version_is(set_version, ""..."1.1.0") do #ruby_version_is ""..."3.3" do
ruby_version_is ""..."3.5" do
ruby_version_is ""..."4.0" do
context "when Set contains a Set-like object" do
it "flattens self, including Set-like objects" do
Set[SetSpecs::SetLike.new([1])].flatten!.should == Set[1]
Expand Down
2 changes: 1 addition & 1 deletion core/set/hash_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Set[1, 2, 3].hash.should_not == Set[:a, "b", ?c].hash
end

ruby_version_is ""..."3.5" do
ruby_version_is ""..."4.0" do
# see https://github.com/jruby/jruby/issues/8393
it "is equal to nil.hash for an uninitialized Set" do
Set.allocate.hash.should == nil.hash
Expand Down
2 changes: 1 addition & 1 deletion core/set/join_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
set.join(' | ').should == "a | b | c"
end

ruby_version_is ""..."3.5" do
ruby_version_is ""..."4.0" do
it "calls #to_a to convert the Set in to an Array" do
set = Set[:a, :b, :c]
set.should_receive(:to_a).and_return([:a, :b, :c])
Expand Down
4 changes: 2 additions & 2 deletions core/set/pretty_print_cycle_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
describe "Set#pretty_print_cycle" do
it "passes the 'pretty print' representation of a self-referencing Set to the pretty print writer" do
pp = mock("PrettyPrint")
ruby_version_is(""..."3.5") do
ruby_version_is(""..."4.0") do
pp.should_receive(:text).with("#<Set: {...}>")
end
ruby_version_is("3.5") do
ruby_version_is("4.0") do
pp.should_receive(:text).with("Set[...]")
end
Set[1, 2, 3].pretty_print_cycle(pp)
Expand Down
2 changes: 1 addition & 1 deletion core/set/proper_subset_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
end

version_is(set_version, ""..."1.1.0") do #ruby_version_is ""..."3.3" do
ruby_version_is ""..."3.5" do
ruby_version_is ""..."4.0" do
context "when comparing to a Set-like object" do
it "returns true if passed a Set-like object that self is a proper subset of" do
Set[1, 2, 3].proper_subset?(SetSpecs::SetLike.new([1, 2, 3, 4])).should be_true
Expand Down
2 changes: 1 addition & 1 deletion core/set/proper_superset_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
-> { Set[].proper_superset?(Object.new) }.should raise_error(ArgumentError)
end

ruby_version_is ""..."3.5" do
ruby_version_is ""..."4.0" do
context "when comparing to a Set-like object" do
it "returns true if passed a Set-like object that self is a proper superset of" do
Set[1, 2, 3, 4].proper_superset?(SetSpecs::SetLike.new([1, 2, 3])).should be_true
Expand Down
Loading