summaryrefslogtreecommitdiff
path: root/jni/ruby/test/psych/test_class.rb
diff options
context:
space:
mode:
authorJari Vetoniemi <jari.vetoniemi@indooratlas.com>2020-03-16 18:49:26 +0900
committerJari Vetoniemi <jari.vetoniemi@indooratlas.com>2020-03-30 00:39:06 +0900
commitfcbf63e62c627deae76c1b8cb8c0876c536ed811 (patch)
tree64cb17de3f41a2b6fef2368028fbd00349946994 /jni/ruby/test/psych/test_class.rb
Fresh start
Diffstat (limited to 'jni/ruby/test/psych/test_class.rb')
-rw-r--r--jni/ruby/test/psych/test_class.rb36
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