public
Description: A lean-and-mean Ruby/ObjC bridge
Homepage: http://rubyobjc.com
Clone URL: git://github.com/timburks/rubyobjc.git
rubyobjc / test / test_exceptions.rb
100644 23 lines (19 sloc) 0.528 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#
# test_exceptions.rb
#
# Tests RubyObjC exception handling.
#
# Copyright (c) 2007 Tim Burks, Neon Design Technology, Inc.
# For more information about this file, visit http://www.rubyobjc.com.
#
 
require 'test/unit'
require 'test/testspeed'
require 'lib/objc'
 
class TestExceptions < Test::Unit::TestCase
 
  def test_argc
    tester = ObjC::Tester.alloc.init
    assert_raise(RuntimeError) {tester.add_to_}
    assert_raise(RuntimeError) {tester.add_to_(1)}
    assert_raise(RuntimeError) {tester.add_to_(1,2,3)}
  end
end