Skip to content

Commit

Permalink
Fix file naming typo (#286)
Browse files Browse the repository at this point in the history
* Fix file naming typo

* Fix rubocop warnings

* Fix tests
  • Loading branch information
route authored Sep 11, 2022
1 parent 024ad04 commit c133613
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 28 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019-2021 Dmitry Vorotilin
Copyright (c) 2019-2022 Dmitry Vorotilin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 5 additions & 5 deletions lib/ferrum/frame.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ def execution_id=(value)
end

def inspect
"#<#{self.class} "\
"@id=#{@id.inspect} "\
"@parent_id=#{@parent_id.inspect} "\
"@name=#{@name.inspect} "\
"@state=#{@state.inspect} "\
"#<#{self.class} " \
"@id=#{@id.inspect} " \
"@parent_id=#{@parent_id.inspect} " \
"@name=#{@name.inspect} " \
"@state=#{@state.inspect} " \
"@execution_id=#{@execution_id.inspect}>"
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/ferrum/network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Network
RESOURCE_TYPES = %w[Document Stylesheet Image Media Font Script TextTrack
XHR Fetch EventSource WebSocket Manifest
SignedExchange Ping CSPViolationReport Other].freeze
AUTHORIZE_BLOCK_MISSING = "Block is missing, call `authorize(...) { |r| r.continue } "\
AUTHORIZE_BLOCK_MISSING = "Block is missing, call `authorize(...) { |r| r.continue } " \
"or subscribe to `on(:request)` events before calling it"
AUTHORIZE_TYPE_WRONG = ":type should be in #{AUTHORIZE_TYPE}"
ALLOWED_CONNECTION_TYPE = %w[none cellular2g cellular3g cellular4g bluetooth ethernet wifi wimax other].freeze
Expand Down
8 changes: 4 additions & 4 deletions lib/ferrum/network/auth_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ def referrer_policy
end

def inspect
"#<#{self.class} "\
"@request_id=#{@request_id.inspect} "\
"@frame_id=#{@frame_id.inspect} "\
"@resource_type=#{@resource_type.inspect} "\
"#<#{self.class} " \
"@request_id=#{@request_id.inspect} " \
"@frame_id=#{@frame_id.inspect} " \
"@resource_type=#{@resource_type.inspect} " \
"@request=#{@request.inspect}>"
end
end
Expand Down
10 changes: 5 additions & 5 deletions lib/ferrum/network/exchange.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ def to_a
end

def inspect
"#<#{self.class} "\
"@id=#{@id.inspect} "\
"@intercepted_request=#{@intercepted_request.inspect} "\
"@request=#{@request.inspect} "\
"@response=#{@response.inspect} "\
"#<#{self.class} " \
"@id=#{@id.inspect} " \
"@intercepted_request=#{@intercepted_request.inspect} " \
"@request=#{@request.inspect} " \
"@response=#{@response.inspect} " \
"@error=#{@error.inspect}>"
end
end
Expand Down
8 changes: 4 additions & 4 deletions lib/ferrum/network/intercepted_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ def referrer_policy
end

def inspect
"#<#{self.class} "\
"@request_id=#{@request_id.inspect} "\
"@frame_id=#{@frame_id.inspect} "\
"@resource_type=#{@resource_type.inspect} "\
"#<#{self.class} " \
"@request_id=#{@request_id.inspect} " \
"@frame_id=#{@frame_id.inspect} " \
"@resource_type=#{@resource_type.inspect} " \
"@request=#{@request.inspect}>"
end

Expand Down
2 changes: 0 additions & 2 deletions lib/ferrum/page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,9 @@ def window_id
@browser.command("Browser.getWindowForTarget", targetId: @target_id)["windowId"]
end

# rubocop:disable Naming/AccessorMethodName
def set_window_bounds(bounds = {})
@browser.command("Browser.setWindowBounds", windowId: window_id, bounds: bounds)
end
# rubocop:enable Naming/AccessorMethodName

def command(method, wait: 0, slowmoable: false, **params)
iteration = @event.reset if wait.positive?
Expand Down
2 changes: 1 addition & 1 deletion lib/ferrum/page/screenshot.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require "ferrum/rbga"
require "ferrum/rgba"

module Ferrum
class Page
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions spec/network_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ module Ferrum
expect do
network.authorize(user: "login", password: "pass")
end.to raise_exception(ArgumentError,
"Block is missing, call `authorize(...) { |r| r.continue }"\
" or subscribe to `on(:request)` events before calling it")
"Block is missing, call `authorize(...) { |r| r.continue } " \
"or subscribe to `on(:request)` events before calling it")
end

it "raises no error when authorize is with block" do
Expand Down
2 changes: 1 addition & 1 deletion spec/node_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module Ferrum
browser.at_xpath("//a[text()='JS redirect']").click
end.to raise_error(
Ferrum::CoordinatesNotFoundError,
"Could not compute content quads"
"Node is either not visible or not an HTMLElement"
)
end

Expand Down
2 changes: 1 addition & 1 deletion spec/rbga_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require "ferrum/rbga"
require "ferrum/rgba"

module Ferrum
describe RGBA do
Expand Down
2 changes: 1 addition & 1 deletion spec/screenshot_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require "image_size"
require "pdf/reader"
require "chunky_png"
require "ferrum/rbga"
require "ferrum/rgba"

module Ferrum
describe Browser do
Expand Down

0 comments on commit c133613

Please sign in to comment.