summaryrefslogtreecommitdiff
path: root/spec/ruby/library/net-http/httpresponse/exception_type_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/net-http/httpresponse/exception_type_spec.rb')
-rw-r--r--spec/ruby/library/net-http/httpresponse/exception_type_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/ruby/library/net-http/httpresponse/exception_type_spec.rb b/spec/ruby/library/net-http/httpresponse/exception_type_spec.rb
new file mode 100644
index 0000000000..dd2761a744
--- /dev/null
+++ b/spec/ruby/library/net-http/httpresponse/exception_type_spec.rb
@@ -0,0 +1,13 @@
+require_relative '../../../spec_helper'
+require 'net/http'
+
+describe "Net::HTTPResponse.exception_type" do
+ it "returns self's 'EXCEPTION_TYPE' constant" do
+ Net::HTTPUnknownResponse.exception_type.should == Net::HTTPError
+ Net::HTTPInformation.exception_type.should == Net::HTTPError
+ Net::HTTPSuccess.exception_type.should == Net::HTTPError
+ Net::HTTPRedirection.exception_type.should == Net::HTTPRetriableError
+ Net::HTTPClientError.exception_type.should == Net::HTTPClientException
+ Net::HTTPServerError.exception_type.should == Net::HTTPFatalError
+ end
+end