diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-06-14 06:41:09 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-06-14 06:41:09 +0000 |
commit | fa0f702c5b455252c66ede8563af7dd928eb8b95 (patch) | |
tree | 96175ecb884b44a6a34927b3509f8fcc4e1135d5 /spec/ruby/library/net/http/httpresponse | |
parent | 99cc20519b884d0d4acce54aa9538e364efd8fab (diff) | |
download | ruby-fa0f702c5b455252c66ede8563af7dd928eb8b95.tar.gz |
HTTPServerException is deprecated
* spec/ruby/library/net/http/HTTPClientException_spec.rb: add.
* spec/ruby/library/net/http/HTTPServerException_spec.rb: check deprecated message.
* spec/ruby/library/net/http/httpresponse/*_spec.rb: use HTTPClientException instead of HTTPServerException.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/library/net/http/httpresponse')
4 files changed, 24 insertions, 4 deletions
diff --git a/spec/ruby/library/net/http/httpresponse/error_spec.rb b/spec/ruby/library/net/http/httpresponse/error_spec.rb index 24297d5fad..a3a3cee162 100644 --- a/spec/ruby/library/net/http/httpresponse/error_spec.rb +++ b/spec/ruby/library/net/http/httpresponse/error_spec.rb @@ -16,7 +16,12 @@ describe "Net::HTTPResponse#error!" do lambda { res.error! }.should raise_error(Net::HTTPRetriableError) res = Net::HTTPClientError.new("1.0", "4xx", "test response") - lambda { res.error! }.should raise_error(Net::HTTPServerException) + ruby_version_is ""..."2.6" do + lambda { res.error! }.should raise_error(Net::HTTPServerException) + end + ruby_version_is "2.6" do + lambda { res.error! }.should raise_error(Net::HTTPClientException) + end res = Net::HTTPServerError.new("1.0", "5xx", "test response") lambda { res.error! }.should raise_error(Net::HTTPFatalError) diff --git a/spec/ruby/library/net/http/httpresponse/error_type_spec.rb b/spec/ruby/library/net/http/httpresponse/error_type_spec.rb index 9e45e8fac2..6705f8b1aa 100644 --- a/spec/ruby/library/net/http/httpresponse/error_type_spec.rb +++ b/spec/ruby/library/net/http/httpresponse/error_type_spec.rb @@ -16,7 +16,12 @@ describe "Net::HTTPResponse#error_type" do res.error_type.should == Net::HTTPRetriableError res = Net::HTTPClientError.new("1.0", "4xx", "test response") - res.error_type.should == Net::HTTPServerException + ruby_version_is ""..."2.6" do + res.error_type.should == Net::HTTPServerException + end + ruby_version_is "2.6" do + res.error_type.should == Net::HTTPClientException + end res = Net::HTTPServerError.new("1.0", "5xx", "test response") res.error_type.should == Net::HTTPFatalError diff --git a/spec/ruby/library/net/http/httpresponse/exception_type_spec.rb b/spec/ruby/library/net/http/httpresponse/exception_type_spec.rb index 74839463b7..c0812cd322 100644 --- a/spec/ruby/library/net/http/httpresponse/exception_type_spec.rb +++ b/spec/ruby/library/net/http/httpresponse/exception_type_spec.rb @@ -7,7 +7,12 @@ describe "Net::HTTPResponse.exception_type" do 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::HTTPServerException + ruby_version_is ""..."2.6" do + Net::HTTPClientError.exception_type.should == Net::HTTPServerException + end + ruby_version_is "2.6" do + Net::HTTPClientError.exception_type.should == Net::HTTPClientException + end Net::HTTPServerError.exception_type.should == Net::HTTPFatalError end end diff --git a/spec/ruby/library/net/http/httpresponse/value_spec.rb b/spec/ruby/library/net/http/httpresponse/value_spec.rb index c53d724b40..1b19d1d6f7 100644 --- a/spec/ruby/library/net/http/httpresponse/value_spec.rb +++ b/spec/ruby/library/net/http/httpresponse/value_spec.rb @@ -16,7 +16,12 @@ describe "Net::HTTPResponse#value" do lambda { res.value }.should raise_error(Net::HTTPRetriableError) res = Net::HTTPClientError.new("1.0", "4xx", "test response") - lambda { res.value }.should raise_error(Net::HTTPServerException) + ruby_version_is ""..."2.6" do + lambda { res.value }.should raise_error(Net::HTTPServerException) + end + ruby_version_is "2.6" do + lambda { res.value }.should raise_error(Net::HTTPClientException) + end res = Net::HTTPServerError.new("1.0", "5xx", "test response") lambda { res.value }.should raise_error(Net::HTTPFatalError) |