diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2013-10-30 10:43:43 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2013-10-30 10:43:43 -0700 |
commit | dae66a0c9733a7fd2ba4357e24b03b386be3e38f (patch) | |
tree | cc37c85d095046fd639a6ff682209d007d3f38b6 /activesupport/test/json | |
parent | 45318e4010e4f6303ef740bf159d2803c28acc7a (diff) | |
parent | 64c88fb5d2caf3c34742a07394ac68b8377c4936 (diff) | |
download | rails-dae66a0c9733a7fd2ba4357e24b03b386be3e38f.tar.gz rails-dae66a0c9733a7fd2ba4357e24b03b386be3e38f.tar.bz2 rails-dae66a0c9733a7fd2ba4357e24b03b386be3e38f.zip |
Merge pull request #12203 from chancancode/eager_load_json
Eagerload active_support/json/encoding in active_support/core_ext/object/to_json
Diffstat (limited to 'activesupport/test/json')
-rw-r--r-- | activesupport/test/json/encoding_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activesupport/test/json/encoding_test.rb b/activesupport/test/json/encoding_test.rb index ed1326705c..d549113ff4 100644 --- a/activesupport/test/json/encoding_test.rb +++ b/activesupport/test/json/encoding_test.rb @@ -1,4 +1,5 @@ # encoding: utf-8 +require 'securerandom' require 'abstract_unit' require 'active_support/core_ext/string/inflections' require 'active_support/json' @@ -96,6 +97,13 @@ class TestJSONEncoding < ActiveSupport::TestCase end end + def test_process_status + # There doesn't seem to be a good way to get a handle on a Process::Status object without actually + # creating a child process, hence this to populate $? + system("not_a_real_program_#{SecureRandom.hex}") + assert_equal %({"exitstatus":#{$?.exitstatus},"pid":#{$?.pid}}), ActiveSupport::JSON.encode($?) + end + def test_hash_encoding assert_equal %({\"a\":\"b\"}), ActiveSupport::JSON.encode(:a => :b) assert_equal %({\"a\":1}), ActiveSupport::JSON.encode('a' => 1) |