Skip to content

Commit dbad851

Browse files
committed
Fix GC.config specs to account for differences between 3.4 and 4.0
1 parent 23595f0 commit dbad851

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

core/gc/config_spec.rb

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,30 @@
3030

3131
it "does not change settings that aren't present in the hash" do
3232
previous = GC.config
33-
GC.config({}).should == previous.except(:implementation)
33+
GC.config({})
3434
GC.config.should == previous
3535
end
3636

3737
it "ignores unknown keys" do
3838
previous = GC.config
39-
GC.config(foo: "bar").should == previous.except(:implementation)
39+
GC.config(foo: "bar")
4040
GC.config.should == previous
4141
end
4242

43+
ruby_version_is ""..."4.0" do
44+
it "returns the same as GC.config but without the :implementation key" do
45+
previous = GC.config
46+
GC.config({}).should == previous.except(:implementation)
47+
end
48+
end
49+
50+
ruby_version_is "4.0" do
51+
it "returns the same as GC.config, including the :implementation key" do
52+
previous = GC.config
53+
GC.config({}).should == previous
54+
end
55+
end
56+
4357
it "raises an ArgumentError if options include global keys" do
4458
-> { GC.config(implementation: "default") }.should raise_error(ArgumentError, 'Attempting to set read-only key "Implementation"')
4559
end

0 commit comments

Comments
 (0)