PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/ruby/throw_exception_runme.rb

#
Ruby | 41 lines | 24 code | 9 blank | 8 comment | 8 complexity | 1d8aa529a57feef005fbc7a239d3e982 MD5 | raw file
 1#!/usr/bin/env ruby
 2#
 3# Put description here
 4#
 5# 
 6# 
 7# 
 8#
 9
10require 'swig_assert'
11
12require 'throw_exception'
13
14include Throw_exception
15
16foo = Foo.new
17
18begin
19  foo.test_int
20rescue => ex
21  raise RuntimeError if ex.message != "37"
22end
23
24begin
25  foo.test_msg
26rescue => ex
27  raise RuntimeError if ex.message != "Dead"
28end
29
30begin
31  foo.test_multi(1)
32rescue => ex
33  raise RuntimeError if ex.message != "37"
34end
35
36begin
37  foo.test_multi(2)
38rescue => ex
39  raise RuntimeError if ex.message != "Dead"
40end
41