From 222cd8dc51617f0ba665c6a3518120e456c6d28f Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Sat, 19 Dec 2015 12:54:13 -0800 Subject: [PATCH] RuboCop fixups --- lib/http/client.rb | 4 ++-- lib/http/request.rb | 4 ++-- spec/lib/http/request_spec.rb | 16 ++++++++-------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/http/client.rb b/lib/http/client.rb index 6f892fff..c4e6b479 100644 --- a/lib/http/client.rb +++ b/lib/http/client.rb @@ -32,13 +32,13 @@ def request(verb, uri, opts = {}) body = make_request_body(opts, headers) proxy = opts.proxy - req = HTTP::Request.new({ + req = HTTP::Request.new( :verb => verb, :uri => uri, :headers => headers, :proxy => proxy, :body => body - }) + ) res = perform(req, opts) return res unless opts.follow diff --git a/lib/http/request.rb b/lib/http/request.rb index 5ac70ef2..a03cf4a9 100644 --- a/lib/http/request.rb +++ b/lib/http/request.rb @@ -88,14 +88,14 @@ def initialize(opts) # Returns new Request with updated uri def redirect(uri, verb = @verb) - req = self.class.new({ + req = self.class.new( :verb => verb, :uri => @uri.join(uri), :headers => headers, :proxy => proxy, :body => body, :version => version - }) + ) req[Headers::HOST] = req.uri.host req diff --git a/spec/lib/http/request_spec.rb b/spec/lib/http/request_spec.rb index cfb59cda..e6d5896b 100644 --- a/spec/lib/http/request_spec.rb +++ b/spec/lib/http/request_spec.rb @@ -6,12 +6,12 @@ let(:request_uri) { "http://example.com/foo?bar=baz" } subject :request do - HTTP::Request.new({ + HTTP::Request.new( :verb => :get, :uri => request_uri, :headers => headers, :proxy => proxy - }) + ) end it "includes HTTP::Headers::Mixin" do @@ -72,13 +72,13 @@ let(:body) { "The Ultimate Question" } let :request do - HTTP::Request.new({ + HTTP::Request.new( :verb => :post, :uri => "http://example.com/", :headers => headers, :proxy => proxy, :body => body - }) + ) end subject(:redirected) { request.redirect "http://blog.example.com/" } @@ -122,13 +122,13 @@ context "with original URI having non-standard port" do let :request do - HTTP::Request.new({ + HTTP::Request.new( :verb => :post, :uri => "http://example.com:8080/", :headers => headers, :proxy => proxy, :body => body - }) + ) end its(:uri) { is_expected.to eq HTTP::URI.parse "http://example.com:8080/blog" } @@ -150,13 +150,13 @@ context "with original URI having non-standard port" do let :request do - HTTP::Request.new({ + HTTP::Request.new( :verb => :post, :uri => "http://example.com:8080/", :headers => headers, :proxy => proxy, :body => body - }) + ) end its(:uri) { is_expected.to eq HTTP::URI.parse "http://example.com:8080/blog" }