test/tests.rb in oj-1.0.4 vs test/tests.rb in oj-1.0.5
- old
+ new
@@ -70,27 +70,30 @@
assert_equal({ :encoding=>nil,
:indent=>0,
:circular=>false,
:auto_define=>true,
:symbol_keys=>false,
+ :ascii_only=>false,
:mode=>:object}, opts)
end
def test0_set_options
orig = {
:encoding=>nil,
:indent=>0,
:circular=>false,
:auto_define=>true,
:symbol_keys=>false,
+ :ascii_only=>false,
:mode=>:object}
o2 = {
:encoding=>"UTF-8",
:indent=>4,
:circular=>true,
:auto_define=>false,
- :symbol_keys=>false,
+ :symbol_keys=>true,
+ :ascii_only=>true,
:mode=>:compat}
o3 = { :indent => 4 }
Oj.default_options = o2
opts = Oj.default_options()
assert_equal(opts, o2);
@@ -141,10 +144,12 @@
end
def test_encode
Oj.default_options = { :encoding => 'UTF-8' }
dump_and_load("ぴーたー", false)
- Oj.default_options = { :encoding => nil }
+ Oj.default_options = { :ascii_only => true }
+ dump_and_load("ぴーたー", false)
+ Oj.default_options = { :encoding => nil, :ascii_only => false }
end
def test_array
dump_and_load([], false)
dump_and_load([true, false], false)