Exercise namespacing in Ruby tests
authorKevin Clark <kclark@apache.org>
Wed, 18 Jun 2008 00:51:45 +0000 (00:51 +0000)
committerKevin Clark <kclark@apache.org>
Wed, 18 Jun 2008 00:51:45 +0000 (00:51 +0000)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668897 13f79535-47bb-0310-9956-ffa450edef68

test/SmallTest.thrift
test/rb/generation/test_struct.rb

index bded87a..531bf17 100644 (file)
@@ -1,4 +1,6 @@
 
+ruby_namespace TestNamespace
+
 struct Goodbyez {
   1: i32 val = 325;
 }
index b6c60ba..3af0df8 100644 (file)
@@ -4,15 +4,15 @@ require 'SmallService'
 class TestStructGeneration < Test::Unit::TestCase
 
   def test_default_values
-    hello = Hello.new
+    hello = TestNamespace::Hello.new
 
-    assert_kind_of(Hello, hello)
+    assert_kind_of(TestNamespace::Hello, hello)
     assert_nil(hello.complexer)
 
     assert_equal(hello.simple, 53)
     assert_equal(hello.words, 'words')
 
-    assert_kind_of(Goodbyez, hello.thinz)
+    assert_kind_of(TestNamespace::Goodbyez, hello.thinz)
     assert_equal(hello.thinz.val, 36632)
 
     assert_kind_of(Hash, hello.complex)
@@ -20,7 +20,7 @@ class TestStructGeneration < Test::Unit::TestCase
   end
 
   def test_goodbyez
-    assert_equal(Goodbyez.new.val, 325)
+    assert_equal(TestNamespace::Goodbyez.new.val, 325)
   end
 
 end