Updates to examples so that they run correctly under Ruby 1.8

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7491 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Charlie Savage 2005-09-23 17:36:37 +00:00
commit 5cff7abd73
4 changed files with 73 additions and 1 deletions

View file

@ -1,4 +1,4 @@
require 'abstract_inherit'
require 'abstract_inherit'
include Abstract_inherit
@ -13,6 +13,10 @@ begin
Foo.new
rescue NameError
exceptionRaised = true
rescue TypeError
# In Ruby 1.8 the exception raised is:
# TypeError: allocator undefined for Abstract_inherit::Foo
exceptionRaised = true
ensure
raise RuntimeError unless exceptionRaised
end
@ -22,6 +26,10 @@ begin
Bar.new
rescue NameError
exceptionRaised = true
rescue TypeError
# In Ruby 1.8 the exception raised is:
# TypeError: allocator undefined for Abstract_inherit::Bar
exceptionRaised = true
ensure
raise RuntimeError unless exceptionRaised
end
@ -31,6 +39,10 @@ begin
Spam.new
rescue NameError
exceptionRaised = true
rescue TypeError
# In Ruby 1.8 the exception raised is:
# TypeError: allocator undefined for Abstract_inherit::Spam
exceptionRaised = true
ensure
raise RuntimeError unless exceptionRaised
end