aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/ruby/cpp_enum_runme.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite/ruby/cpp_enum_runme.rb')
-rw-r--r--Examples/test-suite/ruby/cpp_enum_runme.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/Examples/test-suite/ruby/cpp_enum_runme.rb b/Examples/test-suite/ruby/cpp_enum_runme.rb
new file mode 100644
index 000000000..0a395e0e0
--- /dev/null
+++ b/Examples/test-suite/ruby/cpp_enum_runme.rb
@@ -0,0 +1,19 @@
+#!/usr/bin/env ruby
+#
+# This test implementation is directly derived from its Python counterpart.
+#
+
+require 'swig_assert'
+require 'cpp_enum'
+
+f = Cpp_enum::Foo.new
+swig_assert_equal('f.hola', 'Cpp_enum::Foo::Hello', binding)
+
+f.hola = Cpp_enum::Foo::Hi
+swig_assert_equal('f.hola', 'Cpp_enum::Foo::Hi', binding)
+
+f.hola = Cpp_enum::Foo::Hello
+swig_assert_equal('f.hola', 'Cpp_enum::Foo::Hello', binding)
+
+Cpp_enum::hi = Cpp_enum::Hello
+swig_assert_equal('Cpp_enum::hi', 'Cpp_enum::Hello', binding)