summaryrefslogtreecommitdiff
path: root/spec/unit/http_spec.rb
diff options
context:
space:
mode:
authorClaire McQuin <mcquin@users.noreply.github.com>2014-11-07 14:48:12 -0800
committerClaire McQuin <mcquin@users.noreply.github.com>2014-11-07 14:48:12 -0800
commit1888a8a9c5cbc1bdcfb1d9aa919a911c72cbbff4 (patch)
tree2e3a93f98865ad7091fdd24319b1aba6d03dcc70 /spec/unit/http_spec.rb
parentbf6340a113dd0c37e2084c70007d201742f11e9d (diff)
parent51430f7f2c25773f5ad3c05015eed95d315f798d (diff)
downloadchef-1888a8a9c5cbc1bdcfb1d9aa919a911c72cbbff4.tar.gz
Merge pull request #2324 from opscode/mcquin/rspec-3
Update to RSpec 3
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