summaryrefslogtreecommitdiff
path: root/jni/ruby/test/-ext-/typeddata
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/-ext-/typeddata
Fresh start
Diffstat (limited to 'jni/ruby/test/-ext-/typeddata')
-rw-r--r--jni/ruby/test/-ext-/typeddata/test_typeddata.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/jni/ruby/test/-ext-/typeddata/test_typeddata.rb b/jni/ruby/test/-ext-/typeddata/test_typeddata.rb
new file mode 100644
index 0000000..c24ad08
--- /dev/null
+++ b/jni/ruby/test/-ext-/typeddata/test_typeddata.rb
@@ -0,0 +1,16 @@
+require 'test/unit'
+require "-test-/typeddata/typeddata"
+
+class Test_TypedData < Test::Unit::TestCase
+ def test_wrong_argtype
+ assert_raise_with_message(TypeError, "wrong argument type false (expected typed_data)") {Bug::TypedData.check(false)}
+
+ assert_raise_with_message(TypeError, "wrong argument type true (expected typed_data)") {Bug::TypedData.check(true)}
+
+ assert_raise_with_message(TypeError, "wrong argument type Symbol (expected typed_data)") {Bug::TypedData.check(:e)}
+
+ assert_raise_with_message(TypeError, "wrong argument type Fixnum (expected typed_data)") {Bug::TypedData.check(0)}
+
+ assert_raise_with_message(TypeError, "wrong argument type String (expected typed_data)") {Bug::TypedData.check("a")}
+ end
+end