Mark Slee | 89f5716 | 2008-01-10 00:53:08 +0000 | [diff] [blame] | 1 | #!/usr/bin/env ruby |
| 2 | |
| 3 | $:.push('gen-rb') |
| 4 | $:.push('../../lib/rb/lib') |
| 5 | |
| 6 | require 'SmallService' |
| 7 | require 'rubygems' |
| 8 | require 'test/unit' |
| 9 | |
| 10 | class TestSmallService < Test::Unit::TestCase |
| 11 | |
| 12 | def test_default_value |
| 13 | hello = Hello.new |
| 14 | |
| 15 | assert_kind_of(Hello, hello) |
| 16 | assert_nil(hello.complexer) |
| 17 | |
| 18 | assert_equal(hello.simple, 53) |
| 19 | assert_equal(hello.words, 'words') |
| 20 | |
| 21 | assert_kind_of(Goodbyez, hello.thinz) |
| 22 | assert_equal(hello.thinz.val, 36632) |
| 23 | |
| 24 | assert_kind_of(Hash, hello.complex) |
| 25 | assert_equal(hello.complex, { 6243 => 632, 2355 => 532, 23 => 532}) |
| 26 | end |
| 27 | |
| 28 | def test_goodbyez |
| 29 | assert_equal(Goodbyez.new.val, 325) |
| 30 | end |
| 31 | |
| 32 | end |