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/upload_io.rb'
|
||||||
- 'lib/faraday/utils/headers.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
|
# Offense count: 278
|
||||||
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
||||||
# URISchemes: http, https
|
# URISchemes: http, https
|
||||||
|
@ -33,7 +33,8 @@ module Faraday
|
|||||||
if klass.respond_to?(:name)
|
if klass.respond_to?(:name)
|
||||||
@@constants_mutex.synchronize { @@constants[@name] = klass }
|
@@constants_mutex.synchronize { @@constants[@name] = klass }
|
||||||
end
|
end
|
||||||
@args, @block = args, block
|
@args = args
|
||||||
|
@block = block
|
||||||
end
|
end
|
||||||
|
|
||||||
def klass
|
def klass
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
old_verbose, $VERBOSE = $VERBOSE, nil
|
old_verbose = $VERBOSE
|
||||||
|
$VERBOSE = nil
|
||||||
begin
|
begin
|
||||||
require File.expand_path('../test/live_server', __dir__)
|
require File.expand_path('../test/live_server', __dir__)
|
||||||
ensure
|
ensure
|
||||||
|
@ -74,7 +74,8 @@ module Faraday
|
|||||||
end
|
end
|
||||||
|
|
||||||
def capture_warnings
|
def capture_warnings
|
||||||
old, $stderr = $stderr, StringIO.new
|
old = $stderr
|
||||||
|
$stderr = StringIO.new
|
||||||
begin
|
begin
|
||||||
yield
|
yield
|
||||||
$stderr.string
|
$stderr.string
|
||||||
|
@ -161,7 +161,8 @@ shared_examples 'a request method' do |http_method|
|
|||||||
|
|
||||||
on_feature :parallel do
|
on_feature :parallel do
|
||||||
it 'handles parallel requests' do
|
it 'handles parallel requests' do
|
||||||
resp1, resp2 = nil, nil
|
resp1 = nil
|
||||||
|
resp2 = nil
|
||||||
payload1 = { a: '1' }
|
payload1 = { a: '1' }
|
||||||
payload2 = { b: '2' }
|
payload2 = { b: '2' }
|
||||||
request_stub.with(Hash[query_or_body, payload1])
|
request_stub.with(Hash[query_or_body, payload1])
|
||||||
|
@ -44,8 +44,10 @@ module Adapters
|
|||||||
|
|
||||||
module ParallelNonStreaming
|
module ParallelNonStreaming
|
||||||
def test_callback_is_called_in_parallel_with_no_streaming_support
|
def test_callback_is_called_in_parallel_with_no_streaming_support
|
||||||
resp1, resp2 = nil, nil
|
resp1 = nil
|
||||||
streamed1, streamed2 = nil, nil
|
resp2 = nil
|
||||||
|
streamed1 = nil
|
||||||
|
streamed2 = nil
|
||||||
|
|
||||||
connection = create_connection
|
connection = create_connection
|
||||||
err = capture_warnings do
|
err = capture_warnings do
|
||||||
|
@ -49,7 +49,8 @@ module Faraday
|
|||||||
end unless defined? ::MiniTest
|
end unless defined? ::MiniTest
|
||||||
|
|
||||||
def capture_warnings
|
def capture_warnings
|
||||||
old, $stderr = $stderr, StringIO.new
|
old = $stderr
|
||||||
|
$stderr = StringIO.new
|
||||||
begin
|
begin
|
||||||
yield
|
yield
|
||||||
$stderr.string
|
$stderr.string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user