aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-08-01 15:52:18 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-08-01 15:56:38 -0300
commitaf65b8c9e75052c8ec282e9676502a3a9506ac89 (patch)
treeef69072df640d0c516273532ff0219db142e45d0 /activesupport/test
parent857697bb8722c154163124f25bcf68e39b42ed70 (diff)
downloadrails-af65b8c9e75052c8ec282e9676502a3a9506ac89.tar.gz
rails-af65b8c9e75052c8ec282e9676502a3a9506ac89.tar.bz2
rails-af65b8c9e75052c8ec282e9676502a3a9506ac89.zip
Revert "Deprecate ActiveSupport::JSON::Variable"
This reverts commit bcfa013399fd2c5b5d25c38912cba3560de1cc57.
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/json/encoding_test.rb11
1 files changed, 3 insertions, 8 deletions
diff --git a/activesupport/test/json/encoding_test.rb b/activesupport/test/json/encoding_test.rb
index d327f34140..a9590f164f 100644
--- a/activesupport/test/json/encoding_test.rb
+++ b/activesupport/test/json/encoding_test.rb
@@ -3,7 +3,7 @@ require 'abstract_unit'
require 'active_support/core_ext/string/inflections'
require 'active_support/json'
-class TestJSONEncoding < ActiveSupport::TestCase
+class TestJSONEncoding < Test::Unit::TestCase
class Foo
def initialize(a, b)
@a, @b = a, b
@@ -46,6 +46,8 @@ class TestJSONEncoding < ActiveSupport::TestCase
HashlikeTests = [[ Hashlike.new, %({\"a\":1}) ]]
CustomTests = [[ Custom.new, '"custom"' ]]
+ VariableTests = [[ ActiveSupport::JSON::Variable.new('foo'), 'foo'],
+ [ ActiveSupport::JSON::Variable.new('alert("foo")'), 'alert("foo")']]
RegexpTests = [[ /^a/, '"(?-mix:^a)"' ], [/^\w{1,2}[a-z]+/ix, '"(?ix-m:^\\\\w{1,2}[a-z]+)"']]
DateTests = [[ Date.new(2005,2,1), %("2005/02/01") ]]
@@ -77,13 +79,6 @@ class TestJSONEncoding < ActiveSupport::TestCase
end
end
- def test_json_variable
- assert_deprecated do
- assert_equal ActiveSupport::JSON::Variable.new('foo'), 'foo'
- assert_equal ActiveSupport::JSON::Variable.new('alert("foo")'), 'alert("foo")'
- end
- end
-
def test_hash_encoding
assert_equal %({\"a\":\"b\"}), ActiveSupport::JSON.encode(:a => :b)
assert_equal %({\"a\":1}), ActiveSupport::JSON.encode('a' => 1)