summaryrefslogtreecommitdiff
path: root/test/json
diff options
context:
space:
mode:
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