summaryrefslogtreecommitdiff
path: root/test/json
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-02-23 03:43:58 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-02-23 03:43:58 +0000
commit6604e1b7cd75bef7ed72db699d8f88a7fb56c330 (patch)
treeb92ad3bacaa1f7f54152af362decaadc30466617 /test/json
parentf22ffd83e92a214a697e93fe715d29cbfa52084d (diff)
Merge json-2.2.0 from flori/json.
https://github.com/flori/json/releases/tag/v2.2.0 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/json')
-rw-r--r--test/json/json_addition_test.rb10
-rw-r--r--test/json/test_helper.rb4
2 files changed, 10 insertions, 4 deletions
diff --git a/test/json/json_addition_test.rb b/test/json/json_addition_test.rb
index a028e0f08a..61625f89e2 100644
--- a/test/json/json_addition_test.rb
+++ b/test/json/json_addition_test.rb
@@ -5,6 +5,7 @@ require 'json/add/complex'
require 'json/add/rational'
require 'json/add/bigdecimal'
require 'json/add/ostruct'
+require 'json/add/set'
require 'date'
class JSONAdditionTest < Test::Unit::TestCase
@@ -190,4 +191,13 @@ class JSONAdditionTest < Test::Unit::TestCase
o.foo = { 'bar' => true }
assert_equal o, parse(JSON(o), :create_additions => true)
end
+
+ def test_set
+ s = Set.new([:a, :b, :c, :a])
+ assert_equal s, JSON.parse(JSON(s), :create_additions => true)
+ ss = SortedSet.new([:d, :b, :a, :c])
+ ss_again = JSON.parse(JSON(ss), :create_additions => true)
+ assert_kind_of ss.class, ss_again
+ assert_equal ss, ss_again
+ end
end
diff --git a/test/json/test_helper.rb b/test/json/test_helper.rb
index 7e99c29d0d..c5ec0fca7b 100644
--- a/test/json/test_helper.rb
+++ b/test/json/test_helper.rb
@@ -15,7 +15,3 @@ begin
require 'byebug'
rescue LoadError
end
-if ENV['START_SIMPLECOV'].to_i == 1
- require 'simplecov'
- SimpleCov.start
-end