Skip to content

Commit f87a7aa

Browse files
committed
Fixed linting offenses.
1 parent 312ba9a commit f87a7aa

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/ferrum/page.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -540,11 +540,11 @@ def process_timeout_error(url)
540540
pendings = network.traffic.select(&:pending?).map(&:url).compact
541541
pendings.each do |pending|
542542
# fail if it's on the blocklist
543-
if @options.pending_connection_blocklist.any?{ |regex| pending.match?(regex) }
543+
if @options.pending_connection_blocklist.any? { |regex| pending.match?(regex) }
544544
raise PendingConnectionsError.new(url, pendings)
545545
end
546546
# fail if it's not on the allowlist
547-
unless @options.pending_connection_allowlist.any?{ |regex| pending.match?(regex) }
547+
unless @options.pending_connection_allowlist.any? { |regex| pending.match?(regex) }
548548
raise PendingConnectionsError.new(url, pendings)
549549
end
550550
end

spec/browser_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,21 +243,21 @@
243243
end
244244

245245
it "supports :pending_connection_allowlist argument" do
246-
browser = Ferrum::Browser.new(base_url: base_url, pending_connection_allowlist: %r{slow}, timeout: 0.5)
246+
browser = Ferrum::Browser.new(base_url: base_url, pending_connection_allowlist: /slow/, timeout: 0.5)
247247

248-
expect(browser.options.pending_connection_allowlist).to eq [%r{slow}]
248+
expect(browser.options.pending_connection_allowlist).to eq [/slow/]
249249
expect { browser.go_to("/really_slow") }.not_to raise_error
250250
ensure
251251
browser&.quit
252252
end
253253

254254
it "supports :pending_connection_blocklist argument" do
255255
browser = Ferrum::Browser.new(base_url: base_url,
256-
pending_connection_allowlist: %r{slow},
257-
pending_connection_blocklist: %r{_slow},
256+
pending_connection_allowlist: /slow/,
257+
pending_connection_blocklist: /_slow/,
258258
timeout: 0.5)
259259

260-
expect(browser.options.pending_connection_blocklist).to eq [%r{_slow}]
260+
expect(browser.options.pending_connection_blocklist).to eq [/_slow/]
261261
expect { browser.go_to("/really_slow") }.to raise_error(Ferrum::PendingConnectionsError)
262262
ensure
263263
browser&.quit

0 commit comments

Comments
 (0)