summaryrefslogtreecommitdiff
path: root/Examples/test-suite/ruby/smart_pointer_simple_runme.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite/ruby/smart_pointer_simple_runme.rb')
-rw-r--r--Examples/test-suite/ruby/smart_pointer_simple_runme.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/Examples/test-suite/ruby/smart_pointer_simple_runme.rb b/Examples/test-suite/ruby/smart_pointer_simple_runme.rb
new file mode 100644
index 000000000..b2a54b819
--- /dev/null
+++ b/Examples/test-suite/ruby/smart_pointer_simple_runme.rb
@@ -0,0 +1,13 @@
+require 'smart_pointer_simple'
+
+include Smart_pointer_simple
+
+f = Foo.new
+b = Bar.new(f)
+
+b.x = 3
+raise RuntimeError if b.getx() != 3
+
+fp = b.__deref__()
+fp.x = 4
+raise RuntimeError if fp.getx() != 4