Kevin Clark | 28580f4 | 2008-06-18 00:49:17 +0000 | [diff] [blame] | 1 | require File.join(File.dirname(__FILE__), '../test_helper') |
Mark Slee | 89f5716 | 2008-01-10 00:53:08 +0000 | [diff] [blame] | 2 | require 'SmallService' |
Mark Slee | 89f5716 | 2008-01-10 00:53:08 +0000 | [diff] [blame] | 3 | |
Kevin Clark | 28580f4 | 2008-06-18 00:49:17 +0000 | [diff] [blame] | 4 | class TestStructGeneration < Test::Unit::TestCase |
Mark Slee | 89f5716 | 2008-01-10 00:53:08 +0000 | [diff] [blame] | 5 | |
Kevin Clark | 28580f4 | 2008-06-18 00:49:17 +0000 | [diff] [blame] | 6 | def test_default_values |
Kevin Clark | d5c98ee | 2008-06-18 00:51:45 +0000 | [diff] [blame] | 7 | hello = TestNamespace::Hello.new |
Mark Slee | 89f5716 | 2008-01-10 00:53:08 +0000 | [diff] [blame] | 8 | |
Kevin Clark | d5c98ee | 2008-06-18 00:51:45 +0000 | [diff] [blame] | 9 | assert_kind_of(TestNamespace::Hello, hello) |
Mark Slee | 89f5716 | 2008-01-10 00:53:08 +0000 | [diff] [blame] | 10 | assert_nil(hello.complexer) |
David Reiss | 0c90f6f | 2008-02-06 22:18:40 +0000 | [diff] [blame] | 11 | |
Mark Slee | 89f5716 | 2008-01-10 00:53:08 +0000 | [diff] [blame] | 12 | assert_equal(hello.simple, 53) |
| 13 | assert_equal(hello.words, 'words') |
| 14 | |
Kevin Clark | d5c98ee | 2008-06-18 00:51:45 +0000 | [diff] [blame] | 15 | assert_kind_of(TestNamespace::Goodbyez, hello.thinz) |
Mark Slee | 89f5716 | 2008-01-10 00:53:08 +0000 | [diff] [blame] | 16 | assert_equal(hello.thinz.val, 36632) |
| 17 | |
| 18 | assert_kind_of(Hash, hello.complex) |
| 19 | assert_equal(hello.complex, { 6243 => 632, 2355 => 532, 23 => 532}) |
| 20 | end |
| 21 | |
| 22 | def test_goodbyez |
Kevin Clark | d5c98ee | 2008-06-18 00:51:45 +0000 | [diff] [blame] | 23 | assert_equal(TestNamespace::Goodbyez.new.val, 325) |
Mark Slee | 89f5716 | 2008-01-10 00:53:08 +0000 | [diff] [blame] | 24 | end |
| 25 | |
| 26 | end |