~ubuntu-branches/ubuntu/edgy/swig1.3/edgy

« back to all changes in this revision

Viewing changes to Examples/test-suite/ruby/track_objects_directors_runme.rb

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:16:04 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205011604-ygx904it6413k3go
Tags: 1.3.27-1ubuntu1
Resynchronise with Debian again, for the new subversion packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
require 'track_objects_directors'
 
2
        
 
3
class MyFoo < Track_objects_directors::Foo
 
4
  def ping
 
5
    "MyFoo::ping()"
 
6
  end
 
7
end
 
8
 
 
9
a = MyFoo.new
 
10
 
 
11
raise RuntimeError if a.ping != "MyFoo::ping()"
 
12
raise RuntimeError if a.pong != "Foo::pong();MyFoo::ping()"
 
13
 
 
14
b = Track_objects_directors::Foo.new
 
15
 
 
16
raise RuntimeError if b.ping != "Foo::ping()"
 
17
raise RuntimeError if b.pong != "Foo::pong();Foo::ping()"
 
18
 
 
19
container = Track_objects_directors::Container.new
 
20
foo = MyFoo.new
 
21
container.set_foo(foo)
 
22
    
 
23
myFoo1 = container.get_foo
 
24
myFoo2 = container.get_foo
 
25
 
 
26
if not myFoo1.equal?(myFoo2)
 
27
  raise RuntimeError, "MyFoo's should be the same"
 
28
end