# -*- coding: utf-8 -*- $: << File.expand_path(File.join File.dirname(__FILE__), "..", "ext") require 'test/unit' require 'rucy/tester' class TestTester < Test::Unit::TestCase def setup () @t = Rucy::Tester.new end def test_no_return_returns_nil () assert_equal nil, @t.do_nothing end def test_set_get () @t.value = 100 assert_equal 100, @t.value end def test_no_return_returns_nil () assert_equal nil, @t.do_nothing end def test_returns_nil () assert_equal nil, @t.return_nil end def test_return_int () assert_kind_of Integer, @t.return_int end def test_return_float () assert_kind_of Float, @t.return_float end def test_return_string () assert_kind_of String, @t.return_string end def test_raise_ruby_exception () assert_raise(StandardError) {@t.raise_ruby_exception} end def test_raise_in_eval () assert_raise(RuntimeError) {@t.raise_in_eval} end def test_throw_std_exception () assert_raise(Rucy::NativeError) {@t.throw_std_exception} end def test_throw_std_runtime_error () assert_raise(Rucy::NativeError) {@t.throw_std_runtime_error} end def test_throw_custom_exception () assert_raise(Rucy::NativeError) {@t.throw_custom_exception} end def test_throw_std_string () assert_raise(Rucy::NativeError) {@t.throw_std_string} end def test_throw_cstring () assert_raise(Rucy::NativeError) {@t.throw_cstring} end end # TestTester