swig/SWIG/Examples/test-suite/ruby/abstract_inherit_ok_runme.rb
Logan Johnson f187ed7a05 *** empty log message ***
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4474 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-03-08 03:49:36 +00:00

33 lines
585 B
Ruby

require 'abstract_inherit_ok'
include Abstract_inherit_ok
#
# Shouldn't be able to instantiate Foo, because it declares
# a pure virtual function.
#
exceptionRaised = false
begin
Foo.new
rescue NameError
exceptionRaised = true
ensure
raise RuntimeError unless exceptionRaised
end
#
# This one's OK since we cleared it with a %feature("notabstract")
# declaration in the interface file.
#
exceptionRaised = false
begin
spam = Spam.new
raise RuntimeError unless spam.blah == 0
rescue NameError
exceptionRaised = true
ensure
raise RuntimeError if exceptionRaised
end