diff options
Diffstat (limited to 'jni/ruby/test/psych/test_class.rb')
-rw-r--r-- | jni/ruby/test/psych/test_class.rb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/jni/ruby/test/psych/test_class.rb b/jni/ruby/test/psych/test_class.rb new file mode 100644 index 0000000..c7f964c --- /dev/null +++ b/jni/ruby/test/psych/test_class.rb @@ -0,0 +1,36 @@ +require_relative '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 + + 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 |