summaryrefslogtreecommitdiff
path: root/spec/ruby/core/gc/auto_compact_spec.rb
blob: 33ad1cb56c749f217998f60176c143fe9fad9e6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require_relative '../../spec_helper'

describe "GC.auto_compact" do
  it "can set and get a boolean value" do
    begin
      GC.auto_compact = GC.auto_compact
    rescue NotImplementedError # platform does not support autocompact
      skip
    end

    original = GC.auto_compact
    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