summaryrefslogtreecommitdiff
path: root/test/json/test_json_string_matching.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/json/test_json_string_matching.rb')
-rw-r--r--test/json/test_json_string_matching.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/json/test_json_string_matching.rb b/test/json/test_json_string_matching.rb
index 97e8c0788fe..c233df8c2cd 100644
--- a/test/json/test_json_string_matching.rb
+++ b/test/json/test_json_string_matching.rb
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
-# -*- coding: utf-8 -*-
+# encoding: utf-8
require 'test/unit'
require File.join(File.dirname(__FILE__), 'setup_variant')
@@ -27,14 +27,13 @@ class TestJSONStringMatching < Test::Unit::TestCase
t = TestTime.new
t_json = [ t ].to_json
assert_equal [ t ],
- JSON.parse(t_json,
+ JSON.parse(t_json, :create_additions => true,
:match_string => { /\A\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[+-]\d{4}\z/ => TestTime })
assert_equal [ t.strftime('%FT%T%z') ],
- JSON.parse(t_json,
+ JSON.parse(t_json, :create_additions => true,
:match_string => { /\A\d{3}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[+-]\d{4}\z/ => TestTime })
assert_equal [ t.strftime('%FT%T%z') ],
JSON.parse(t_json,
- :match_string => { /\A\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[+-]\d{4}\z/ => TestTime },
- :create_additions => false)
+ :match_string => { /\A\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[+-]\d{4}\z/ => TestTime })
end
end