PageRenderTime 39ms CodeModel.GetById 27ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 1ms

/trunk/Examples/test-suite/ruby/ruby_track_objects_directors_runme.rb

#
Ruby | 39 lines | 21 code | 10 blank | 8 comment | 9 complexity | f1ac7dd6f3b9fef326d63b3b013f23da MD5 | raw file
 1#!/usr/bin/env ruby
 2#
 3# Put description here
 4#
 5# 
 6# 
 7# 
 8#
 9
10require 'swig_assert'
11
12require 'ruby_track_objects_directors'
13	
14class MyFoo < Ruby_track_objects_directors::Foo
15  def ping
16    "MyFoo::ping()"
17  end
18end
19
20a = MyFoo.new
21
22raise RuntimeError if a.ping != "MyFoo::ping()"
23raise RuntimeError if a.pong != "Foo::pong();MyFoo::ping()"
24
25b = Ruby_track_objects_directors::Foo.new
26
27raise RuntimeError if b.ping != "Foo::ping()"
28raise RuntimeError if b.pong != "Foo::pong();Foo::ping()"
29
30container = Ruby_track_objects_directors::Container.new
31foo = MyFoo.new
32container.set_foo(foo)
33    
34myFoo1 = container.get_foo
35myFoo2 = container.get_foo
36
37if not myFoo1.equal?(myFoo2)
38  raise RuntimeError, "MyFoo's should be the same"
39end