Skip to content

Commit

Permalink
RuboCop fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
tarcieri committed Dec 19, 2015
1 parent 6c8f123 commit 222cd8d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions lib/http/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/http/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions spec/lib/http/request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/" }
Expand Down Expand Up @@ -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" }
Expand All @@ -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" }
Expand Down

0 comments on commit 222cd8d

Please sign in to comment.