summaryrefslogtreecommitdiff
path: root/test/json/test_json_rails.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-20 17:41:14 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-20 17:41:14 +0000
commite8eb95ec33334f40f3f3bbcbf16404aee07dfa8e (patch)
treec7fade34f792e138365b59af246ea316616c04e7 /test/json/test_json_rails.rb
parenta91cd48aa19dd31ec5abb6e4b982f2077bedcbcd (diff)
* ext/json: import JSON v 1.1.3.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/json/test_json_rails.rb')
-rw-r--r--test/json/test_json_rails.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/json/test_json_rails.rb b/test/json/test_json_rails.rb
index e44ea606e3..c0447ddaba 100644
--- a/test/json/test_json_rails.rb
+++ b/test/json/test_json_rails.rb
@@ -31,6 +31,10 @@ class TC_JSONRails < Test::Unit::TestCase
end
class B
+ def self.json_creatable?
+ false
+ end
+
def to_json(*args)
{
'json_class' => self.class.name,
@@ -46,9 +50,6 @@ class TC_JSONRails < Test::Unit::TestCase
end
end
- def setup
- end
-
def test_extended_json
a = A.new(666)
assert A.json_creatable?
@@ -73,14 +74,14 @@ class TC_JSONRails < Test::Unit::TestCase
)
end
- def test_extended_json_fail
+ def test_extended_json_fail1
b = B.new
assert !B.json_creatable?
json = generate(b)
assert_equal({ 'json_class' => B.name }, JSON.parse(json))
end
- def test_extended_json_fail
+ def test_extended_json_fail2
c = C.new # with rails addition all objects are theoretically creatable
assert C.json_creatable?
json = generate(c)