diff options
Diffstat (limited to 'spec/unit/http/http_request_spec.rb')
-rw-r--r-- | spec/unit/http/http_request_spec.rb | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/spec/unit/http/http_request_spec.rb b/spec/unit/http/http_request_spec.rb index 3bba201963..33da210c36 100644 --- a/spec/unit/http/http_request_spec.rb +++ b/spec/unit/http/http_request_spec.rb @@ -16,40 +16,40 @@ # limitations under the License. # -require 'spec_helper' +require "spec_helper" describe Chef::HTTP::HTTPRequest do context "with HTTP url scheme" do it "should not include port 80 in Host header" do - request = Chef::HTTP::HTTPRequest.new(:GET, URI('http://dummy.com'), '') + request = Chef::HTTP::HTTPRequest.new(:GET, URI("http://dummy.com"), "") - expect(request.headers['Host']).to eql('dummy.com') + expect(request.headers["Host"]).to eql("dummy.com") end it "should not include explicit port 80 in Host header" do - request = Chef::HTTP::HTTPRequest.new(:GET, URI('http://dummy.com:80'), '') + request = Chef::HTTP::HTTPRequest.new(:GET, URI("http://dummy.com:80"), "") - expect(request.headers['Host']).to eql('dummy.com') + expect(request.headers["Host"]).to eql("dummy.com") end it "should include explicit port 8000 in Host header" do - request = Chef::HTTP::HTTPRequest.new(:GET, URI('http://dummy.com:8000'), '') + request = Chef::HTTP::HTTPRequest.new(:GET, URI("http://dummy.com:8000"), "") - expect(request.headers['Host']).to eql('dummy.com:8000') + expect(request.headers["Host"]).to eql("dummy.com:8000") end it "should include explicit 443 port in Host header" do - request = Chef::HTTP::HTTPRequest.new(:GET, URI('http://dummy.com:443'), '') + request = Chef::HTTP::HTTPRequest.new(:GET, URI("http://dummy.com:443"), "") - expect(request.headers['Host']).to eql('dummy.com:443') + expect(request.headers["Host"]).to eql("dummy.com:443") end it "should pass on explicit Host header unchanged" do - request = Chef::HTTP::HTTPRequest.new(:GET, URI('http://dummy.com:8000'), '', { 'Host' => 'yourhost.com:8888' }) + request = Chef::HTTP::HTTPRequest.new(:GET, URI("http://dummy.com:8000"), "", { "Host" => "yourhost.com:8888" }) - expect(request.headers['Host']).to eql('yourhost.com:8888') + expect(request.headers["Host"]).to eql("yourhost.com:8888") end end @@ -57,35 +57,35 @@ describe Chef::HTTP::HTTPRequest do context "with HTTPS url scheme" do it "should not include port 443 in Host header" do - request = Chef::HTTP::HTTPRequest.new(:GET, URI('https://dummy.com'), '') + request = Chef::HTTP::HTTPRequest.new(:GET, URI("https://dummy.com"), "") - expect(request.headers['Host']).to eql('dummy.com') + expect(request.headers["Host"]).to eql("dummy.com") end it "should include explicit port 80 in Host header" do - request = Chef::HTTP::HTTPRequest.new(:GET, URI('https://dummy.com:80'), '') + request = Chef::HTTP::HTTPRequest.new(:GET, URI("https://dummy.com:80"), "") - expect(request.headers['Host']).to eql('dummy.com:80') + expect(request.headers["Host"]).to eql("dummy.com:80") end it "should include explicit port 8000 in Host header" do - request = Chef::HTTP::HTTPRequest.new(:GET, URI('https://dummy.com:8000'), '') + request = Chef::HTTP::HTTPRequest.new(:GET, URI("https://dummy.com:8000"), "") - expect(request.headers['Host']).to eql('dummy.com:8000') + expect(request.headers["Host"]).to eql("dummy.com:8000") end it "should not include explicit port 443 in Host header" do - request = Chef::HTTP::HTTPRequest.new(:GET, URI('https://dummy.com:443'), '') + request = Chef::HTTP::HTTPRequest.new(:GET, URI("https://dummy.com:443"), "") - expect(request.headers['Host']).to eql('dummy.com') + expect(request.headers["Host"]).to eql("dummy.com") end end it "should pass on explicit Host header unchanged" do - request = Chef::HTTP::HTTPRequest.new(:GET, URI('http://dummy.com:8000'), '', { 'Host' => 'myhost.com:80' }) + request = Chef::HTTP::HTTPRequest.new(:GET, URI("http://dummy.com:8000"), "", { "Host" => "myhost.com:80" }) - expect(request.headers['Host']).to eql('myhost.com:80') + expect(request.headers["Host"]).to eql("myhost.com:80") end end |