Fixes Rubocop Style/ParallelAssignment

This commit is contained in:
iMacTia 2019-03-03 19:23:46 +00:00
parent 376eb2307a
commit f8f5985f3e
7 changed files with 14 additions and 18 deletions

View File

@ -175,17 +175,6 @@ Style/NumericPredicate:
- 'lib/faraday/upload_io.rb'
- 'lib/faraday/utils/headers.rb'
# Offense count: 7
# Cop supports --auto-correct.
Style/ParallelAssignment:
Exclude:
- 'lib/faraday/rack_builder.rb'
- 'script/server'
- 'spec/support/helper_methods.rb'
- 'spec/support/shared_examples/request_method.rb'
- 'test/adapters/integration.rb'
- 'test/helper.rb'
# Offense count: 278
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https

View File

@ -33,7 +33,8 @@ module Faraday
if klass.respond_to?(:name)
@@constants_mutex.synchronize { @@constants[@name] = klass }
end
@args, @block = args, block
@args = args
@block = block
end
def klass

View File

@ -1,7 +1,8 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
old_verbose, $VERBOSE = $VERBOSE, nil
old_verbose = $VERBOSE
$VERBOSE = nil
begin
require File.expand_path('../test/live_server', __dir__)
ensure

View File

@ -74,7 +74,8 @@ module Faraday
end
def capture_warnings
old, $stderr = $stderr, StringIO.new
old = $stderr
$stderr = StringIO.new
begin
yield
$stderr.string

View File

@ -161,7 +161,8 @@ shared_examples 'a request method' do |http_method|
on_feature :parallel do
it 'handles parallel requests' do
resp1, resp2 = nil, nil
resp1 = nil
resp2 = nil
payload1 = { a: '1' }
payload2 = { b: '2' }
request_stub.with(Hash[query_or_body, payload1])

View File

@ -44,8 +44,10 @@ module Adapters
module ParallelNonStreaming
def test_callback_is_called_in_parallel_with_no_streaming_support
resp1, resp2 = nil, nil
streamed1, streamed2 = nil, nil
resp1 = nil
resp2 = nil
streamed1 = nil
streamed2 = nil
connection = create_connection
err = capture_warnings do

View File

@ -49,7 +49,8 @@ module Faraday
end unless defined? ::MiniTest
def capture_warnings
old, $stderr = $stderr, StringIO.new
old = $stderr
$stderr = StringIO.new
begin
yield
$stderr.string