diff options
author | John Shahid <jvshahid@gmail.com> | 2012-11-23 03:19:08 -0500 |
---|---|---|
committer | John Shahid <jvshahid@gmail.com> | 2012-11-23 03:21:09 -0500 |
commit | 00333cd538abd9a963a5b2baca186489dc335d98 (patch) | |
tree | 53034f96e22fdcdff918a3c5bf4e954ce5e6305c /tests | |
parent | e3c6a7c7fee695b45b9cd2bf062138bcc54b2d28 (diff) | |
download | json-00333cd538abd9a963a5b2baca186489dc335d98.tar.gz |
add tests to test the behavior of State::configure (and its alias State::merge).
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/test_json_generate.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_json_generate.rb b/tests/test_json_generate.rb index a7975bf..50f5f02 100755 --- a/tests/test_json_generate.rb +++ b/tests/test_json_generate.rb @@ -228,6 +228,22 @@ EOT end if GC.respond_to?(:stress=) if defined?(JSON::Ext::Generator) + [:merge, :configure].each do |method| + define_method "test_configure_using_#{method}" do + state = JSON::Ext::Generator::State.new + state.send method, :indent => "1", + :space => '2', + :space_before => '3', + :object_nl => '4', + :array_nl => '5' + assert_equal '1', state.indent + assert_equal '2', state.space + assert_equal '3', state.space_before + assert_equal '4', state.object_nl + assert_equal '5', state.array_nl + end + end + def test_broken_bignum # [ruby-core:38867] pid = fork do Bignum.class_eval do |