Skip to content

Commit 168c9f5

Browse files
committed
[rb] make suggested updates from rubocop
1 parent c2ea3b2 commit 168c9f5

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

rb/lib/selenium/webdriver/bidi/log_inspector.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,28 +50,28 @@ def initialize(driver, browsing_context_ids = nil)
5050
@bidi.session.subscribe('log.entryAdded', browsing_context_ids)
5151
end
5252

53-
def on_console_entry(filter_by = nil, &block)
53+
def on_console_entry(...)
5454
check_valid_filter(filter_by)
5555

5656
on_log do |params|
5757
type = params['type']
58-
console_log_events(params, filter_by, &block) if type.eql?('console')
58+
console_log_events(params, filter_by, ...) if type.eql?('console')
5959
end
6060
end
6161

62-
def on_javascript_log(filter_by = nil, &block)
62+
def on_javascript_log(...)
6363
check_valid_filter(filter_by)
6464

6565
on_log do |params|
6666
type = params['type']
67-
javascript_log_events(params, filter_by, &block) if type.eql?('javascript')
67+
javascript_log_events(params, filter_by, ...) if type.eql?('javascript')
6868
end
6969
end
7070

71-
def on_javascript_exception(&block)
71+
def on_javascript_exception(...)
7272
on_log do |params|
7373
type = params['type']
74-
javascript_log_events(params, FilterBy.log_level('error'), &block) if type.eql?('javascript')
74+
javascript_log_events(params, ...) if type.eql?('javascript')
7575
end
7676
end
7777

rb/lib/selenium/webdriver/common/zipper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ def zip_file(path)
7171

7272
private
7373

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

rb/lib/selenium/webdriver/devtools/network_interceptor.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ def initialize(devtools)
4343
@lock = Mutex.new
4444
end
4545

46-
def intercept(&block)
46+
def intercept(...)
4747
devtools.network.on(:loading_failed) { |params| track_cancelled_request(params) }
48-
devtools.fetch.on(:request_paused) { |params| request_paused(params, &block) }
48+
devtools.fetch.on(:request_paused) { |params| request_paused(params, ...) }
4949

5050
devtools.network.set_cache_disabled(cache_disabled: true)
5151
devtools.network.enable

rb/spec/unit/selenium/webdriver/wait_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def wait(*args)
5151
expect(wait.until(&block)).to be true
5252
end
5353

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

5757
expect {

0 commit comments

Comments
 (0)