Only compact if 3.1
@@ -221,8 +221,10 @@ class ObjectJuice < Minitest::Test
def teardown
Oj.default_options = @default_options
+ if '3.1.0' < RUBY_VERSION
GC.verify_compaction_references(double_heap: true, toward: :empty)
end
+ end
def test_nil
dump_and_load(nil, false)
