mirror of
https://github.com/lostisland/faraday.git
synced 2025-10-04 00:02:03 -04:00
chore: RuboCop lint Layout/SpaceInsideBlockBraces
This commit is contained in:
parent
ba6247eb35
commit
7ddccdbd1e
@ -102,7 +102,7 @@ module Faraday
|
|||||||
failed_stubs = []
|
failed_stubs = []
|
||||||
@stack.each do |method, stubs|
|
@stack.each do |method, stubs|
|
||||||
unless stubs.empty?
|
unless stubs.empty?
|
||||||
failed_stubs.concat(stubs.map {|stub|
|
failed_stubs.concat(stubs.map { |stub|
|
||||||
"Expected #{method} #{stub}."
|
"Expected #{method} #{stub}."
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
@ -20,7 +20,7 @@ module Faraday
|
|||||||
ESCAPE_RE = /[^a-zA-Z0-9 .~_-]/
|
ESCAPE_RE = /[^a-zA-Z0-9 .~_-]/
|
||||||
|
|
||||||
def escape(s)
|
def escape(s)
|
||||||
s.to_s.gsub(ESCAPE_RE) {|match|
|
s.to_s.gsub(ESCAPE_RE) { |match|
|
||||||
'%' + match.unpack('H2' * match.bytesize).join('%').upcase
|
'%' + match.unpack('H2' * match.bytesize).join('%').upcase
|
||||||
}.tr(' ', '+')
|
}.tr(' ', '+')
|
||||||
end
|
end
|
||||||
|
@ -28,7 +28,7 @@ end
|
|||||||
|
|
||||||
def write(file, contents, env_var)
|
def write(file, contents, env_var)
|
||||||
FileUtils.mkdir_p(File.dirname(file))
|
FileUtils.mkdir_p(File.dirname(file))
|
||||||
File.open(file, 'w') {|f| f.puts(contents) }
|
File.open(file, 'w') { |f| f.puts(contents) }
|
||||||
puts %(export #{env_var}="#{file}") if $shell
|
puts %(export #{env_var}="#{file}") if $shell
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ RSpec.describe Faraday::CompositeReadIO do
|
|||||||
context 'with utf8 multibyte part' do
|
context 'with utf8 multibyte part' do
|
||||||
subject { composite_io(part("\x86"), part('ファイル')) }
|
subject { composite_io(part("\x86"), part('ファイル')) }
|
||||||
|
|
||||||
it { expect(subject.read).to eq(String.new("\x86\xE3\x83\x95\xE3\x82\xA1\xE3\x82\xA4\xE3\x83\xAB", encoding: 'BINARY'))}
|
it { expect(subject.read).to eq(String.new("\x86\xE3\x83\x95\xE3\x82\xA1\xE3\x82\xA4\xE3\x83\xAB", encoding: 'BINARY')) }
|
||||||
it 'allows to read in chunks' do
|
it 'allows to read in chunks' do
|
||||||
expect(subject.read(3)).to eq(String.new("\x86\xE3\x83", encoding: 'BINARY'))
|
expect(subject.read(3)).to eq(String.new("\x86\xE3\x83", encoding: 'BINARY'))
|
||||||
expect(subject.read(3)).to eq(String.new("\x95\xE3\x82", encoding: 'BINARY'))
|
expect(subject.read(3)).to eq(String.new("\x95\xE3\x82", encoding: 'BINARY'))
|
||||||
|
@ -40,7 +40,7 @@ RSpec.describe Faraday::Utils do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it 'parses with block' do
|
it 'parses with block' do
|
||||||
with_default_uri_parser(lambda {|u| "booya#{"!" * u.size}" }) do
|
with_default_uri_parser(lambda { |u| "booya#{"!" * u.size}" }) do
|
||||||
expect(normalize(url)).to eq('booya!!!!!!!!!!!!!!!!!!!!!!')
|
expect(normalize(url)).to eq('booya!!!!!!!!!!!!!!!!!!!!!!')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -93,7 +93,7 @@ module Faraday
|
|||||||
|
|
||||||
def big_string
|
def big_string
|
||||||
kb = 1024
|
kb = 1024
|
||||||
(32..126).map {|i| i.chr}.cycle.take(50 * kb).join
|
(32..126).map { |i| i.chr }.cycle.take(50 * kb).join
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -4,7 +4,7 @@ module Faraday
|
|||||||
module Shared
|
module Shared
|
||||||
def self.big_string
|
def self.big_string
|
||||||
kb = 1024
|
kb = 1024
|
||||||
(32..126).map {|i| i.chr}.cycle.take(50 * kb).join
|
(32..126).map { |i| i.chr }.cycle.take(50 * kb).join
|
||||||
end
|
end
|
||||||
|
|
||||||
def big_string
|
def big_string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user