summaryrefslogtreecommitdiff
path: root/spec/ruby/library/net/http/httpresponse
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/net/http/httpresponse')
-rw-r--r--spec/ruby/library/net/http/httpresponse/error_spec.rb14
-rw-r--r--spec/ruby/library/net/http/httpresponse/read_body_spec.rb6
-rw-r--r--spec/ruby/library/net/http/httpresponse/value_spec.rb14
3 files changed, 17 insertions, 17 deletions
diff --git a/spec/ruby/library/net/http/httpresponse/error_spec.rb b/spec/ruby/library/net/http/httpresponse/error_spec.rb
index a3a3cee162..d2b2f53d89 100644
--- a/spec/ruby/library/net/http/httpresponse/error_spec.rb
+++ b/spec/ruby/library/net/http/httpresponse/error_spec.rb
@@ -4,26 +4,26 @@ require 'net/http'
describe "Net::HTTPResponse#error!" do
it "raises self's class 'EXCEPTION_TYPE' Exception" do
res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
- lambda { res.error! }.should raise_error(Net::HTTPError)
+ -> { res.error! }.should raise_error(Net::HTTPError)
res = Net::HTTPInformation.new("1.0", "1xx", "test response")
- lambda { res.error! }.should raise_error(Net::HTTPError)
+ -> { res.error! }.should raise_error(Net::HTTPError)
res = Net::HTTPSuccess.new("1.0", "2xx", "test response")
- lambda { res.error! }.should raise_error(Net::HTTPError)
+ -> { res.error! }.should raise_error(Net::HTTPError)
res = Net::HTTPRedirection.new("1.0", "3xx", "test response")
- lambda { res.error! }.should raise_error(Net::HTTPRetriableError)
+ -> { res.error! }.should raise_error(Net::HTTPRetriableError)
res = Net::HTTPClientError.new("1.0", "4xx", "test response")
ruby_version_is ""..."2.6" do
- lambda { res.error! }.should raise_error(Net::HTTPServerException)
+ -> { res.error! }.should raise_error(Net::HTTPServerException)
end
ruby_version_is "2.6" do
- lambda { res.error! }.should raise_error(Net::HTTPClientException)
+ -> { 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)
+ -> { res.error! }.should raise_error(Net::HTTPFatalError)
end
end
diff --git a/spec/ruby/library/net/http/httpresponse/read_body_spec.rb b/spec/ruby/library/net/http/httpresponse/read_body_spec.rb
index a050eca594..99d8e5fa88 100644
--- a/spec/ruby/library/net/http/httpresponse/read_body_spec.rb
+++ b/spec/ruby/library/net/http/httpresponse/read_body_spec.rb
@@ -40,7 +40,7 @@ describe "Net::HTTPResponse#read_body" do
it "raises an IOError if called a second time" do
@res.reading_body(@socket, true) do
@res.read_body("")
- lambda { @res.read_body("") }.should raise_error(IOError)
+ -> { @res.read_body("") }.should raise_error(IOError)
end
end
end
@@ -70,7 +70,7 @@ describe "Net::HTTPResponse#read_body" do
it "raises an IOError if called a second time" do
@res.reading_body(@socket, true) do
@res.read_body {}
- lambda { @res.read_body {} }.should raise_error(IOError)
+ -> { @res.read_body {} }.should raise_error(IOError)
end
end
end
@@ -78,7 +78,7 @@ describe "Net::HTTPResponse#read_body" do
describe "when passed buffer and block" do
it "raises an ArgumentError" do
@res.reading_body(@socket, true) do
- lambda { @res.read_body("") {} }.should raise_error(ArgumentError)
+ -> { @res.read_body("") {} }.should raise_error(ArgumentError)
end
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 1b19d1d6f7..4a5930d4e5 100644
--- a/spec/ruby/library/net/http/httpresponse/value_spec.rb
+++ b/spec/ruby/library/net/http/httpresponse/value_spec.rb
@@ -4,26 +4,26 @@ require 'net/http'
describe "Net::HTTPResponse#value" do
it "raises an HTTP error for non 2xx HTTP Responses" do
res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
- lambda { res.value }.should raise_error(Net::HTTPError)
+ -> { res.value }.should raise_error(Net::HTTPError)
res = Net::HTTPInformation.new("1.0", "1xx", "test response")
- lambda { res.value }.should raise_error(Net::HTTPError)
+ -> { res.value }.should raise_error(Net::HTTPError)
res = Net::HTTPSuccess.new("1.0", "2xx", "test response")
- lambda { res.value }.should_not raise_error(Net::HTTPError)
+ -> { res.value }.should_not raise_error(Net::HTTPError)
res = Net::HTTPRedirection.new("1.0", "3xx", "test response")
- lambda { res.value }.should raise_error(Net::HTTPRetriableError)
+ -> { res.value }.should raise_error(Net::HTTPRetriableError)
res = Net::HTTPClientError.new("1.0", "4xx", "test response")
ruby_version_is ""..."2.6" do
- lambda { res.value }.should raise_error(Net::HTTPServerException)
+ -> { res.value }.should raise_error(Net::HTTPServerException)
end
ruby_version_is "2.6" do
- lambda { res.value }.should raise_error(Net::HTTPClientException)
+ -> { 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)
+ -> { res.value }.should raise_error(Net::HTTPFatalError)
end
end