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:
parent
a19ec091b8
commit
5cff7abd73
4 changed files with 73 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue