summaryrefslogtreecommitdiff
path: root/test/json/json_addition_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/json/json_addition_test.rb')
-rw-r--r--test/json/json_addition_test.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/json/json_addition_test.rb b/test/json/json_addition_test.rb
index e95ace8375..3a7a58176a 100644
--- a/test/json/json_addition_test.rb
+++ b/test/json/json_addition_test.rb
@@ -1,5 +1,5 @@
#frozen_string_literal: false
-require 'test_helper'
+require_relative 'test_helper'
require 'json/add/core'
require 'json/add/complex'
require 'json/add/rational'
@@ -165,7 +165,7 @@ class JSONAdditionTest < Test::Unit::TestCase
def test_utc_datetime
now = Time.now
- d = DateTime.parse(now.to_s, :create_additions => true) # usual case
+ d = DateTime.parse(now.to_s) # usual case
assert_equal d, parse(d.to_json, :create_additions => true)
d = DateTime.parse(now.utc.to_s) # of = 0
assert_equal d, parse(d.to_json, :create_additions => true)
@@ -183,14 +183,14 @@ class JSONAdditionTest < Test::Unit::TestCase
def test_bigdecimal
assert_equal BigDecimal('3.141', 23), JSON(JSON(BigDecimal('3.141', 23)), :create_additions => true)
assert_equal BigDecimal('3.141', 666), JSON(JSON(BigDecimal('3.141', 666)), :create_additions => true)
- end
+ end if defined?(::BigDecimal)
def test_ostruct
o = OpenStruct.new
# XXX this won't work; o.foo = { :bar => true }
o.foo = { 'bar' => true }
assert_equal o, parse(JSON(o), :create_additions => true)
- end
+ end if defined?(::OpenStruct)
def test_set
s = Set.new([:a, :b, :c, :a])