Update version guards in ruby/spec

This commit is contained in:
Benoit Daloze 2025-12-30 12:47:01 +01:00
parent c970d2941d
commit a7fec4d661
Notes: git 2025-12-30 15:03:19 +00:00
3 changed files with 8 additions and 8 deletions

View File

@ -109,10 +109,10 @@ describe "Method#source_location" do
eval('def self.m; end', nil, "foo", 100)
end
location = c.method(:m).source_location
ruby_version_is(""..."4.0") do
ruby_version_is(""..."4.1") do
location.should == ["foo", 100]
end
ruby_version_is("4.0") do
ruby_version_is("4.1") do
location.should == ["foo", 100, 0, 100, 15]
end
end

View File

@ -53,12 +53,12 @@ describe "Proc#source_location" do
end
it "works even if the proc was created on the same line" do
ruby_version_is(""..."4.0") do
ruby_version_is(""..."4.1") 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("4.0") do
ruby_version_is("4.1") 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__, 6, __LINE__, 17]
@ -94,10 +94,10 @@ describe "Proc#source_location" do
it "works for eval with a given line" do
proc = eval('-> {}', nil, "foo", 100)
location = proc.source_location
ruby_version_is(""..."4.0") do
ruby_version_is(""..."4.1") do
location.should == ["foo", 100]
end
ruby_version_is("4.0") do
ruby_version_is("4.1") do
location.should == ["foo", 100, 0, 100, 5]
end
end

View File

@ -55,10 +55,10 @@ describe "UnboundMethod#source_location" do
eval('def m; end', nil, "foo", 100)
end
location = c.instance_method(:m).source_location
ruby_version_is(""..."4.0") do
ruby_version_is(""..."4.1") do
location.should == ["foo", 100]
end
ruby_version_is("4.0") do
ruby_version_is("4.1") do
location.should == ["foo", 100, 0, 100, 10]
end
end