summaryrefslogtreecommitdiff
path: root/spec/unit/http_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/http_spec.rb')
-rw-r--r--spec/unit/http_spec.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/unit/http_spec.rb b/spec/unit/http_spec.rb
index 1cd226b4ee..60d36eb4a0 100644
--- a/spec/unit/http_spec.rb
+++ b/spec/unit/http_spec.rb
@@ -31,17 +31,17 @@ describe Chef::HTTP do
it 'should return a correctly formatted url 1/3 CHEF-5261' do
http = Chef::HTTP.new('http://www.getchef.com')
- http.create_url('api/endpoint').should eql(URI.parse('http://www.getchef.com/api/endpoint'))
+ expect(http.create_url('api/endpoint')).to eql(URI.parse('http://www.getchef.com/api/endpoint'))
end
it 'should return a correctly formatted url 2/3 CHEF-5261' do
http = Chef::HTTP.new('http://www.getchef.com/')
- http.create_url('/organization/org/api/endpoint/').should eql(URI.parse('http://www.getchef.com/organization/org/api/endpoint/'))
+ expect(http.create_url('/organization/org/api/endpoint/')).to eql(URI.parse('http://www.getchef.com/organization/org/api/endpoint/'))
end
it 'should return a correctly formatted url 3/3 CHEF-5261' do
http = Chef::HTTP.new('http://www.getchef.com/organization/org///')
- http.create_url('///api/endpoint?url=http://foo.bar').should eql(URI.parse('http://www.getchef.com/organization/org/api/endpoint?url=http://foo.bar'))
+ expect(http.create_url('///api/endpoint?url=http://foo.bar')).to eql(URI.parse('http://www.getchef.com/organization/org/api/endpoint?url=http://foo.bar'))
end
end # create_url
@@ -50,20 +50,20 @@ describe Chef::HTTP do
it 'should return nil for a "200 Success" response (CHEF-4762)' do
resp = Net::HTTPOK.new("1.1", 200, "OK")
- resp.should_receive(:read_body).and_return(nil)
+ expect(resp).to receive(:read_body).and_return(nil)
http = Chef::HTTP.new("")
- Chef::HTTP::BasicClient.any_instance.should_receive(:request).and_return(["request", resp])
+ expect_any_instance_of(Chef::HTTP::BasicClient).to receive(:request).and_return(["request", resp])
- http.head("http://www.getchef.com/").should eql(nil)
+ expect(http.head("http://www.getchef.com/")).to eql(nil)
end
it 'should return false for a "304 Not Modified" response (CHEF-4762)' do
resp = Net::HTTPNotModified.new("1.1", 304, "Not Modified")
- resp.should_receive(:read_body).and_return(nil)
+ expect(resp).to receive(:read_body).and_return(nil)
http = Chef::HTTP.new("")
- Chef::HTTP::BasicClient.any_instance.should_receive(:request).and_return(["request", resp])
+ expect_any_instance_of(Chef::HTTP::BasicClient).to receive(:request).and_return(["request", resp])
- http.head("http://www.getchef.com/").should eql(false)
+ expect(http.head("http://www.getchef.com/")).to eql(false)
end
end # head