mirror of
https://github.com/lostisland/faraday.git
synced 2025-10-04 00:02:03 -04:00
Fixes Rubocop Style/ParallelAssignment
This commit is contained in:
parent
376eb2307a
commit
f8f5985f3e
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -74,7 +74,8 @@ module Faraday
|
||||
end
|
||||
|
||||
def capture_warnings
|
||||
old, $stderr = $stderr, StringIO.new
|
||||
old = $stderr
|
||||
$stderr = StringIO.new
|
||||
begin
|
||||
yield
|
||||
$stderr.string
|
||||
|
@ -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])
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user