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.rb12
-rw-r--r--spec/ruby/library/net-http/httpresponse/header_spec.rb2
-rw-r--r--spec/ruby/library/net-http/httpresponse/inspect_spec.rb2
-rw-r--r--spec/ruby/library/net-http/httpresponse/read_body_spec.rb16
-rw-r--r--spec/ruby/library/net-http/httpresponse/read_header_spec.rb2
-rw-r--r--spec/ruby/library/net-http/httpresponse/read_new_spec.rb2
-rw-r--r--spec/ruby/library/net-http/httpresponse/reading_body_spec.rb16
-rw-r--r--spec/ruby/library/net-http/httpresponse/response_spec.rb2
-rw-r--r--spec/ruby/library/net-http/httpresponse/shared/body.rb4
-rw-r--r--spec/ruby/library/net-http/httpresponse/value_spec.rb12
10 files changed, 35 insertions, 35 deletions
diff --git a/spec/ruby/library/net-http/httpresponse/error_spec.rb b/spec/ruby/library/net-http/httpresponse/error_spec.rb
index 6ced90fa23..e194df95af 100644
--- a/spec/ruby/library/net-http/httpresponse/error_spec.rb
+++ b/spec/ruby/library/net-http/httpresponse/error_spec.rb
@@ -4,21 +4,21 @@ 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")
- -> { res.error! }.should raise_error(Net::HTTPError)
+ -> { res.error! }.should.raise(Net::HTTPError)
res = Net::HTTPInformation.new("1.0", "1xx", "test response")
- -> { res.error! }.should raise_error(Net::HTTPError)
+ -> { res.error! }.should.raise(Net::HTTPError)
res = Net::HTTPSuccess.new("1.0", "2xx", "test response")
- -> { res.error! }.should raise_error(Net::HTTPError)
+ -> { res.error! }.should.raise(Net::HTTPError)
res = Net::HTTPRedirection.new("1.0", "3xx", "test response")
- -> { res.error! }.should raise_error(Net::HTTPRetriableError)
+ -> { res.error! }.should.raise(Net::HTTPRetriableError)
res = Net::HTTPClientError.new("1.0", "4xx", "test response")
- -> { res.error! }.should raise_error(Net::HTTPClientException)
+ -> { res.error! }.should.raise(Net::HTTPClientException)
res = Net::HTTPServerError.new("1.0", "5xx", "test response")
- -> { res.error! }.should raise_error(Net::HTTPFatalError)
+ -> { res.error! }.should.raise(Net::HTTPFatalError)
end
end
diff --git a/spec/ruby/library/net-http/httpresponse/header_spec.rb b/spec/ruby/library/net-http/httpresponse/header_spec.rb
index a403dbd2c3..3ddadfb8e4 100644
--- a/spec/ruby/library/net-http/httpresponse/header_spec.rb
+++ b/spec/ruby/library/net-http/httpresponse/header_spec.rb
@@ -4,6 +4,6 @@ require 'net/http'
describe "Net::HTTPResponse#header" do
it "returns self" do
res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
- res.response.should equal(res)
+ res.response.should.equal?(res)
end
end
diff --git a/spec/ruby/library/net-http/httpresponse/inspect_spec.rb b/spec/ruby/library/net-http/httpresponse/inspect_spec.rb
index 23b6bff581..43071ec8cd 100644
--- a/spec/ruby/library/net-http/httpresponse/inspect_spec.rb
+++ b/spec/ruby/library/net-http/httpresponse/inspect_spec.rb
@@ -8,7 +8,7 @@ describe "Net::HTTPResponse#inspect" do
res.inspect.should == "#<Net::HTTPUnknownResponse ??? test response readbody=false>"
res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
- socket = Net::BufferedIO.new(StringIO.new(+"test body"))
+ socket = Net::BufferedIO.new(StringIO.new("test body"))
res.reading_body(socket, true) {}
res.inspect.should == "#<Net::HTTPUnknownResponse ??? test response readbody=true>"
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 61a576d812..d8b2418624 100644
--- a/spec/ruby/library/net-http/httpresponse/read_body_spec.rb
+++ b/spec/ruby/library/net-http/httpresponse/read_body_spec.rb
@@ -5,7 +5,7 @@ require 'stringio'
describe "Net::HTTPResponse#read_body" do
before :each do
@res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
- @socket = Net::BufferedIO.new(StringIO.new(+"test body"))
+ @socket = Net::BufferedIO.new(StringIO.new("test body"))
end
describe "when passed no arguments" do
@@ -17,7 +17,7 @@ describe "Net::HTTPResponse#read_body" do
it "returns the previously read body if called a second time" do
@res.reading_body(@socket, true) do
- @res.read_body.should equal(@res.read_body)
+ @res.read_body.should.equal?(@res.read_body)
end
end
end
@@ -34,14 +34,14 @@ describe "Net::HTTPResponse#read_body" do
it "returns the passed buffer" do
@res.reading_body(@socket, true) do
buffer = +""
- @res.read_body(buffer).should equal(buffer)
+ @res.read_body(buffer).should.equal?(buffer)
end
end
it "raises an IOError if called a second time" do
@res.reading_body(@socket, true) do
@res.read_body(+"")
- -> { @res.read_body(+"") }.should raise_error(IOError)
+ -> { @res.read_body(+"") }.should.raise(IOError)
end
end
end
@@ -57,21 +57,21 @@ describe "Net::HTTPResponse#read_body" do
buffer << body
end
- yielded.should be_true
+ yielded.should == true
buffer.should == "test body"
end
end
it "returns the ReadAdapter" do
@res.reading_body(@socket, true) do
- @res.read_body { nil }.should be_kind_of(Net::ReadAdapter)
+ @res.read_body { nil }.should.is_a?(Net::ReadAdapter)
end
end
it "raises an IOError if called a second time" do
@res.reading_body(@socket, true) do
@res.read_body {}
- -> { @res.read_body {} }.should raise_error(IOError)
+ -> { @res.read_body {} }.should.raise(IOError)
end
end
end
@@ -79,7 +79,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
- -> { @res.read_body(+"") {} }.should raise_error(ArgumentError)
+ -> { @res.read_body(+"") {} }.should.raise(ArgumentError)
end
end
end
diff --git a/spec/ruby/library/net-http/httpresponse/read_header_spec.rb b/spec/ruby/library/net-http/httpresponse/read_header_spec.rb
index 3ea4ee834b..70ce988502 100644
--- a/spec/ruby/library/net-http/httpresponse/read_header_spec.rb
+++ b/spec/ruby/library/net-http/httpresponse/read_header_spec.rb
@@ -4,6 +4,6 @@ require 'net/http'
describe "Net::HTTPResponse#read_header" do
it "returns self" do
res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
- res.response.should equal(res)
+ res.response.should.equal?(res)
end
end
diff --git a/spec/ruby/library/net-http/httpresponse/read_new_spec.rb b/spec/ruby/library/net-http/httpresponse/read_new_spec.rb
index 82f7a47ce8..3795e29d83 100644
--- a/spec/ruby/library/net-http/httpresponse/read_new_spec.rb
+++ b/spec/ruby/library/net-http/httpresponse/read_new_spec.rb
@@ -12,7 +12,7 @@ test-body
EOS
response = Net::HTTPResponse.read_new(socket)
- response.should be_kind_of(Net::HTTPOK)
+ response.should.is_a?(Net::HTTPOK)
response.code.should == "200"
response["Content-Type"].should == "text/html; charset=utf-8"
diff --git a/spec/ruby/library/net-http/httpresponse/reading_body_spec.rb b/spec/ruby/library/net-http/httpresponse/reading_body_spec.rb
index b9ab112c96..a3671d6eb5 100644
--- a/spec/ruby/library/net-http/httpresponse/reading_body_spec.rb
+++ b/spec/ruby/library/net-http/httpresponse/reading_body_spec.rb
@@ -5,7 +5,7 @@ require "stringio"
describe "Net::HTTPResponse#reading_body" do
before :each do
@res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
- @socket = Net::BufferedIO.new(StringIO.new(+"test body"))
+ @socket = Net::BufferedIO.new(StringIO.new("test body"))
end
describe "when body_allowed is true" do
@@ -22,7 +22,7 @@ describe "Net::HTTPResponse#reading_body" do
yielded = true
end
- yielded.should be_true
+ yielded.should == true
end
describe "but the response type is not allowed to have a body" do
@@ -31,28 +31,28 @@ describe "Net::HTTPResponse#reading_body" do
end
it "returns nil" do
- @res.reading_body(@socket, false) {}.should be_nil
- @res.body.should be_nil
+ @res.reading_body(@socket, false) {}.should == nil
+ @res.body.should == nil
end
it "yields the passed block" do
yielded = false
@res.reading_body(@socket, true) { yielded = true }
- yielded.should be_true
+ yielded.should == true
end
end
end
describe "when body_allowed is false" do
it "returns nil" do
- @res.reading_body(@socket, false) {}.should be_nil
- @res.body.should be_nil
+ @res.reading_body(@socket, false) {}.should == nil
+ @res.body.should == nil
end
it "yields the passed block" do
yielded = false
@res.reading_body(@socket, true) { yielded = true }
- yielded.should be_true
+ yielded.should == true
end
end
end
diff --git a/spec/ruby/library/net-http/httpresponse/response_spec.rb b/spec/ruby/library/net-http/httpresponse/response_spec.rb
index caa0ca2d19..440c33c168 100644
--- a/spec/ruby/library/net-http/httpresponse/response_spec.rb
+++ b/spec/ruby/library/net-http/httpresponse/response_spec.rb
@@ -4,6 +4,6 @@ require 'net/http'
describe "Net::HTTPResponse#response" do
it "returns self" do
res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
- res.response.should equal(res)
+ res.response.should.equal?(res)
end
end
diff --git a/spec/ruby/library/net-http/httpresponse/shared/body.rb b/spec/ruby/library/net-http/httpresponse/shared/body.rb
index f35ca3200c..368774fb52 100644
--- a/spec/ruby/library/net-http/httpresponse/shared/body.rb
+++ b/spec/ruby/library/net-http/httpresponse/shared/body.rb
@@ -3,7 +3,7 @@ require 'stringio'
describe :net_httpresponse_body, shared: true do
before :each do
@res = Net::HTTPUnknownResponse.new("1.0", "???", "test response")
- @socket = Net::BufferedIO.new(StringIO.new(+"test body"))
+ @socket = Net::BufferedIO.new(StringIO.new("test body"))
end
it "returns the read body" do
@@ -14,7 +14,7 @@ describe :net_httpresponse_body, shared: true do
it "returns the previously read body if called a second time" do
@res.reading_body(@socket, true) do
- @res.send(@method).should equal(@res.send(@method))
+ @res.send(@method).should.equal?(@res.send(@method))
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 2df8beaa10..e32d37500a 100644
--- a/spec/ruby/library/net-http/httpresponse/value_spec.rb
+++ b/spec/ruby/library/net-http/httpresponse/value_spec.rb
@@ -4,21 +4,21 @@ 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")
- -> { res.value }.should raise_error(Net::HTTPError)
+ -> { res.value }.should.raise(Net::HTTPError)
res = Net::HTTPInformation.new("1.0", "1xx", "test response")
- -> { res.value }.should raise_error(Net::HTTPError)
+ -> { res.value }.should.raise(Net::HTTPError)
res = Net::HTTPSuccess.new("1.0", "2xx", "test response")
- -> { res.value }.should_not raise_error(Net::HTTPError)
+ -> { res.value }.should_not.raise(Net::HTTPError)
res = Net::HTTPRedirection.new("1.0", "3xx", "test response")
- -> { res.value }.should raise_error(Net::HTTPRetriableError)
+ -> { res.value }.should.raise(Net::HTTPRetriableError)
res = Net::HTTPClientError.new("1.0", "4xx", "test response")
- -> { res.value }.should raise_error(Net::HTTPClientException)
+ -> { res.value }.should.raise(Net::HTTPClientException)
res = Net::HTTPServerError.new("1.0", "5xx", "test response")
- -> { res.value }.should raise_error(Net::HTTPFatalError)
+ -> { res.value }.should.raise(Net::HTTPFatalError)
end
end