Skip to content

Commit

Permalink
chore: rubocop -A
Browse files Browse the repository at this point in the history
  • Loading branch information
route committed Dec 13, 2023
1 parent 9292d11 commit b5d72b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/capybara/cuprite/driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def debug_url
devtools_frontend_path = response[0]&.[]("devtoolsFrontendUrl")
raise "Could not generate debug url for remote debugging session" unless devtools_frontend_path

build_remote_debug_url path: devtools_frontend_path
build_remote_debug_url(path: devtools_frontend_path)
end

def debug(binding = nil)
Expand Down
12 changes: 6 additions & 6 deletions spec/lib/driver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
describe Capybara::Cuprite::Driver do
describe "options" do
it "sets the remote-allow-origins option" do
driver = described_class.new nil
driver = described_class.new(nil)

expect(driver.browser.options.to_h).to include("remote-allow-origins": "*")
end
Expand Down Expand Up @@ -31,14 +31,14 @@

describe "debug_url" do
it "parses the devtools frontend url correctly" do
driver = described_class.new nil, {port: 12345}
driver = described_class.new(nil, { port: 12_345 })
driver.browser # initialize browser before stubbing Net::HTTP as it also calls it
uri = instance_double URI
uri = instance_double(URI)

allow(driver).to receive(:URI).with("http://127.0.0.1:12345/json").and_return uri
allow(Net::HTTP).to receive(:get).with(uri).and_return "[{\"devtoolsFrontendUrl\":\"/works\"}]"
allow(driver).to receive(:URI).with("http://127.0.0.1:12345/json").and_return(uri)
allow(Net::HTTP).to receive(:get).with(uri).and_return(%([{"devtoolsFrontendUrl":"/works"}]))

expect(driver.debug_url).to eq "http://127.0.0.1:12345/works"
expect(driver.debug_url).to eq("http://127.0.0.1:12345/works")
end
end

Expand Down

0 comments on commit b5d72b9

Please sign in to comment.