Skip to content

Commit

Permalink
[rb] make suggested updates from rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Jan 25, 2024
1 parent c2ea3b2 commit 168c9f5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions rb/lib/selenium/webdriver/bidi/log_inspector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,28 @@ def initialize(driver, browsing_context_ids = nil)
@bidi.session.subscribe('log.entryAdded', browsing_context_ids)
end

def on_console_entry(filter_by = nil, &block)
def on_console_entry(...)
check_valid_filter(filter_by)

on_log do |params|
type = params['type']
console_log_events(params, filter_by, &block) if type.eql?('console')
console_log_events(params, filter_by, ...) if type.eql?('console')
end
end

def on_javascript_log(filter_by = nil, &block)
def on_javascript_log(...)
check_valid_filter(filter_by)

on_log do |params|
type = params['type']
javascript_log_events(params, filter_by, &block) if type.eql?('javascript')
javascript_log_events(params, filter_by, ...) if type.eql?('javascript')
end
end

def on_javascript_exception(&block)
def on_javascript_exception(...)
on_log do |params|
type = params['type']
javascript_log_events(params, FilterBy.log_level('error'), &block) if type.eql?('javascript')
javascript_log_events(params, ...) if type.eql?('javascript')
end
end

Expand Down
4 changes: 2 additions & 2 deletions rb/lib/selenium/webdriver/common/zipper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ def zip_file(path)

private

def with_tmp_zip(&blk)
def with_tmp_zip(...)
# Don't use Tempfile since it lacks rb_file_s_rename permission on Windows.
Dir.mktmpdir do |tmp_dir|
zip_path = File.join(tmp_dir, 'webdriver-zip')
Zip::File.open(zip_path, Zip::File::CREATE, &blk)
Zip::File.open(zip_path, ...)
end
end

Expand Down
4 changes: 2 additions & 2 deletions rb/lib/selenium/webdriver/devtools/network_interceptor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ def initialize(devtools)
@lock = Mutex.new
end

def intercept(&block)
def intercept(...)
devtools.network.on(:loading_failed) { |params| track_cancelled_request(params) }
devtools.fetch.on(:request_paused) { |params| request_paused(params, &block) }
devtools.fetch.on(:request_paused) { |params| request_paused(params, ...) }

devtools.network.set_cache_disabled(cache_disabled: true)
devtools.network.enable
Expand Down
2 changes: 1 addition & 1 deletion rb/spec/unit/selenium/webdriver/wait_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def wait(*args)
expect(wait.until(&block)).to be true
end

it 'will use the message from any NoSuchElementError raised while waiting' do
it 'uses the message from any NoSuchElementError raised while waiting' do
block = -> { raise Error::NoSuchElementError, 'foo' }

expect {
Expand Down

0 comments on commit 168c9f5

Please sign in to comment.