Added swig_assert.rb and started using it in some tests. Added my patches to ruby.cxx, rubyrun.swg, rubystrings.swg and rubytracking.swg [see: sourceforge] git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9691 626c5289-ae23-0410-ae9c-e8d60b6d4f22
54 lines
845 B
Ruby
54 lines
845 B
Ruby
#!/usr/bin/env ruby
|
|
#
|
|
# Put description here
|
|
#
|
|
# Author:: gga
|
|
# Copyright:: 2007
|
|
# License:: SWIG
|
|
#
|
|
|
|
require 'swig_assert'
|
|
|
|
require 'director_nested'
|
|
|
|
NoProtectedError = Kernel.const_defined?("NoMethodError") ? NoMethodError : NameError
|
|
|
|
class A < Director_nested::FooBar_int
|
|
protected
|
|
def do_step
|
|
"A::do_step;"
|
|
end
|
|
|
|
def get_value
|
|
"A::get_value"
|
|
end
|
|
end
|
|
|
|
a = A.new
|
|
|
|
begin
|
|
a.do_advance
|
|
rescue NoProtectedError
|
|
end
|
|
|
|
raise RuntimeError if a.step != "Bar::step;Foo::advance;Bar::do_advance;A::do_step;"
|
|
|
|
|
|
class B < Director_nested::FooBar_int
|
|
protected
|
|
def do_advance
|
|
"B::do_advance;" + do_step
|
|
end
|
|
|
|
def do_step
|
|
"B::do_step;"
|
|
end
|
|
|
|
def get_value
|
|
"B::get_value"
|
|
end
|
|
end
|
|
|
|
|
|
b = B.new
|
|
raise RuntimeError if b.step != "Bar::step;Foo::advance;B::do_advance;B::do_step;"
|