| Gavin McDonald | 0b75e1a | 2010-10-28 02:12:01 +0000 | [diff] [blame^] | 1 | # |
| 2 | # Licensed to the Apache Software Foundation (ASF) under one |
| 3 | # or more contributor license agreements. See the NOTICE file |
| 4 | # distributed with this work for additional information |
| 5 | # regarding copyright ownership. The ASF licenses this file |
| 6 | # to you under the Apache License, Version 2.0 (the |
| 7 | # "License"); you may not use this file except in compliance |
| 8 | # with the License. You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, |
| 13 | # software distributed under the License is distributed on an |
| 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | # KIND, either express or implied. See the License for the |
| 16 | # specific language governing permissions and limitations |
| 17 | # under the License. |
| 18 | # |
| 19 | |
| 20 | require File.join(File.dirname(__FILE__), '../test_helper') |
| 21 | require 'small_service' |
| 22 | |
| 23 | class TestStructGeneration < Test::Unit::TestCase |
| 24 | |
| 25 | def test_default_values |
| 26 | hello = TestNamespace::Hello.new |
| 27 | |
| 28 | assert_kind_of(TestNamespace::Hello, hello) |
| 29 | assert_nil(hello.complexer) |
| 30 | |
| 31 | assert_equal(hello.simple, 53) |
| 32 | assert_equal(hello.words, 'words') |
| 33 | |
| 34 | assert_kind_of(TestNamespace::Goodbyez, hello.thinz) |
| 35 | assert_equal(hello.thinz.val, 36632) |
| 36 | |
| 37 | assert_kind_of(Hash, hello.complex) |
| 38 | assert_equal(hello.complex, { 6243 => 632, 2355 => 532, 23 => 532}) |
| 39 | |
| 40 | bool_passer = TestNamespace::BoolPasser.new(:value => false) |
| 41 | assert_equal false, bool_passer.value |
| 42 | end |
| 43 | |
| 44 | def test_goodbyez |
| 45 | assert_equal(TestNamespace::Goodbyez.new.val, 325) |
| 46 | end |
| 47 | |
| 48 | end |