summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2021-10-29 21:54:17 +0200
committerBenoit Daloze <eregontp@gmail.com>2021-10-29 21:54:17 +0200
commit800dad62970989c0afeb26f1780c53683335a8d9 (patch)
tree5ae64f204c328d4cbf53c55a2f3d9de3b487c273 /spec
parent2e14fb7df752573da98be84a686d8bbd210b13d8 (diff)
Skip GC.auto_compact= spec for platforms not supporting it
* See https://github.com/ruby/spec/pull/891
Diffstat (limited to 'spec')
-rw-r--r--spec/ruby/core/gc/auto_compact_spec.rb21
1 files changed, 11 insertions, 10 deletions
diff --git a/spec/ruby/core/gc/auto_compact_spec.rb b/spec/ruby/core/gc/auto_compact_spec.rb
index d77ed44452..96e7d3923c 100644
--- a/spec/ruby/core/gc/auto_compact_spec.rb
+++ b/spec/ruby/core/gc/auto_compact_spec.rb
@@ -2,18 +2,19 @@ require_relative '../../spec_helper'
ruby_version_is "3.0" do
describe "GC.auto_compact" do
- before :each do
- @default = GC.auto_compact
- end
-
- after :each do
- GC.auto_compact = @default
- end
-
it "can set and get a boolean value" do
original = GC.auto_compact
- GC.auto_compact = !original
- GC.auto_compact.should == !original
+ begin
+ GC.auto_compact = !original
+ rescue NotImplementedError # platform does not support autocompact
+ skip
+ end
+
+ begin
+ GC.auto_compact.should == !original
+ ensure
+ GC.auto_compact = original
+ end
end
end
end