summaryrefslogtreecommitdiff
path: root/test/rb
diff options
context:
space:
mode:
authorKevin Clark <kclark@apache.org>2008-06-18 00:54:13 +0000
committerKevin Clark <kclark@apache.org>2008-06-18 00:54:13 +0000
commit2960044415917973aeeb8c6d9132319eef69139a (patch)
treeea1e940d067d24ae00c4371ca1fa3774545eda45 /test/rb
parent10cdf10a7bd5326680cc2384f8a812cff573a1df (diff)
downloadthrift-2960044415917973aeeb8c6d9132319eef69139a.tar.gz
rb: Add more classes/modules to the Thrift namespace. Provide backwards compatable mappings.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668904 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/rb')
-rw-r--r--test/rb/core/test_backwards_compatability.rb32
-rw-r--r--test/rb/core/test_exceptions.rb4
2 files changed, 34 insertions, 2 deletions
diff --git a/test/rb/core/test_backwards_compatability.rb b/test/rb/core/test_backwards_compatability.rb
new file mode 100644
index 000000000..a826f2026
--- /dev/null
+++ b/test/rb/core/test_backwards_compatability.rb
@@ -0,0 +1,32 @@
+require File.join(File.dirname(__FILE__), '../test_helper')
+
+require 'thrift/thrift'
+
+class TestTException < Test::Unit::TestCase
+ def test_has_accessible_message
+ msg = "hi there thrift"
+ assert_equal msg, TException.new(msg).message
+ end
+
+end
+
+class TestConstRemapping < Test::Unit::TestCase
+ def test_remappings
+ maps = {
+ TException => Thrift::Exception,
+ TApplicationException => Thrift::ApplicationException,
+ TType => Thrift::Types,
+ TMessageType => Thrift::MessageTypes,
+ TProcessor => Thrift::Processor,
+ ThriftClient => Thrift::Client,
+ ThriftStruct => Thrift::Struct,
+ TProtocol => Thrift::Protocol,
+ TProtocolException => Thrift::ProtocolException
+ }
+
+ maps.each do |k, v|
+ assert_equal k, v
+ end
+ end
+end
+
diff --git a/test/rb/core/test_exceptions.rb b/test/rb/core/test_exceptions.rb
index eb63963be..88aacb0b6 100644
--- a/test/rb/core/test_exceptions.rb
+++ b/test/rb/core/test_exceptions.rb
@@ -2,10 +2,10 @@ require File.join(File.dirname(__FILE__), '../test_helper')
require 'thrift/thrift'
-class TestTException < Test::Unit::TestCase
+class TestException < Test::Unit::TestCase
def test_has_accessible_message
msg = "hi there thrift"
- assert_equal msg, TException.new(msg).message
+ assert_equal msg, Thrift::Exception.new(msg).message
end
end