From aaa52bf088d9f78d8e578ead12695a73639fc95a Mon Sep 17 00:00:00 2001 From: tenderlove Date: Thu, 9 Jun 2011 00:22:33 +0000 Subject: * ext/psych/lib/psych/visitors/to_ruby.rb: Ruby modules can be loaded from YAML files. * ext/psych/lib/psych/visitors/yaml_tree.rb: Ruby modules can be dumped to YAML files. * test/psych/test_class.rb: corresponding test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/psych/test_class.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test') diff --git a/test/psych/test_class.rb b/test/psych/test_class.rb index 8fd4ad0952..156f2fb0ad 100644 --- a/test/psych/test_class.rb +++ b/test/psych/test_class.rb @@ -2,12 +2,21 @@ require 'psych/helper' module Psych class TestClass < TestCase + module Foo + end + def test_cycle_anonymous_class assert_raises(::TypeError) do assert_cycle(Class.new) end end + def test_cycle_anonymous_module + assert_raises(::TypeError) do + assert_cycle(Module.new) + end + end + def test_cycle assert_cycle(TestClass) end @@ -15,5 +24,13 @@ module Psych def test_dump Psych.dump TestClass end + + def test_cycle_module + assert_cycle(Foo) + end + + def test_dump_module + Psych.dump Foo + end end end -- cgit v1.2.3