Sha256: c494d0bd39105b8ffab27d90ae305f0bb6c567b1bf62032b87c30149b3fb5b69

Contents?: true

Size: 851 Bytes

Versions: 19

Compression:

Stored size: 851 Bytes

Contents

# frozen_string_literal: true

$: << File.dirname(__FILE__)
$oj_dir = File.dirname(File.dirname(File.expand_path(File.dirname(__FILE__))))
%w(lib ext).each do |dir|
  $: << File.join($oj_dir, dir)
end

require 'test/unit'
REAL_JSON_GEM = !!ENV['REAL_JSON_GEM']

if ENV['REAL_JSON_GEM']
  require 'json'
else
  require 'oj'
  Oj.mimic_JSON

  # This method was added in Ruby 3.0.0. Calling it this way asks the GC to
  # move objects around, helping to find object movement bugs.
  if defined?(GC.verify_compaction_references) == 'method'
    if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.2.0")
      GC.verify_compaction_references(expand_heap: true, toward: :empty)
    else
      GC.verify_compaction_references(double_heap: true, toward: :empty)
    end
  end
end

NaN = JSON::NaN if defined?(JSON::NaN)
NaN = 0.0/0 unless defined?(NaN)

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
oj-3.16.7 test/json_gem/test_helper.rb
oj-3.16.6 test/json_gem/test_helper.rb
oj-3.16.5 test/json_gem/test_helper.rb
oj-3.16.4 test/json_gem/test_helper.rb
oj-3.16.3 test/json_gem/test_helper.rb
oj-3.16.2 test/json_gem/test_helper.rb
oj-3.16.1 test/json_gem/test_helper.rb
oj-3.16.0 test/json_gem/test_helper.rb
oj-3.15.1 test/json_gem/test_helper.rb
oj-3.15.0 test/json_gem/test_helper.rb
oj-3.14.3 test/json_gem/test_helper.rb
oj-3.14.2 test/json_gem/test_helper.rb
oj-3.14.1 test/json_gem/test_helper.rb
oj-3.14.0 test/json_gem/test_helper.rb
oj-3.13.23 test/json_gem/test_helper.rb
oj-3.13.22 test/json_gem/test_helper.rb
oj-3.13.21 test/json_gem/test_helper.rb
oj-3.13.20 test/json_gem/test_helper.rb
oj-3.13.19 test/json_gem/test_helper.rb