Kevin Clark | 95833c5 | 2008-06-18 01:04:34 +0000 | [diff] [blame^] | 1 | require File.dirname(__FILE__) + '/spec_helper' |
| 2 | |
| 3 | describe Thrift::Exception do |
| 4 | it "should have an accessible message" do |
| 5 | e = Thrift::Exception.new("test message") |
| 6 | e.message.should == "test message" |
| 7 | end |
| 8 | end |
| 9 | |
| 10 | describe Thrift::ApplicationException do |
| 11 | it "should inherit from Thrift::Exception" do |
| 12 | Thrift::ApplicationException.superclass.should == Thrift::Exception |
| 13 | end |
| 14 | |
| 15 | it "should have an accessible type and message" do |
| 16 | e = Thrift::ApplicationException.new |
| 17 | e.type.should == Thrift::ApplicationException::UNKNOWN |
| 18 | e.message.should be_nil |
| 19 | e = Thrift::ApplicationException.new(Thrift::ApplicationException::UNKNOWN_METHOD, "test message") |
| 20 | e.type.should == Thrift::ApplicationException::UNKNOWN_METHOD |
| 21 | e.message.should == "test message" |
| 22 | end |
| 23 | end |