Skip to content

Commit f7e5b45

Browse files
committed
[rb] update with linter fixes
1 parent 65b59ae commit f7e5b45

File tree

7 files changed

+33
-33
lines changed

7 files changed

+33
-33
lines changed

rb/Gemfile.lock

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ GEM
3939
drb (2.2.0)
4040
ruby2_keywords
4141
ffi (1.16.3)
42+
ffi (1.16.3-x64-mingw32)
4243
fileutils (1.7.2)
4344
hashdiff (1.0.1)
4445
i18n (1.14.1)
@@ -75,7 +76,7 @@ GEM
7576
rb-fsevent (0.11.2)
7677
rb-inotify (0.10.1)
7778
ffi (~> 1.0)
78-
rbs (3.3.0)
79+
rbs (3.3.2)
7980
abbrev
8081
rdoc (6.6.0)
8182
psych (>= 4.0.0)
@@ -124,7 +125,7 @@ GEM
124125
ruby2_keywords (0.0.5)
125126
rubyzip (2.3.2)
126127
securerandom (0.3.0)
127-
steep (1.6.0)
128+
steep (1.5.3)
128129
activesupport (>= 5.1)
129130
concurrent-ruby (>= 1.1.10)
130131
csv (>= 3.0.9)
@@ -172,10 +173,10 @@ DEPENDENCIES
172173
rubocop-rspec (~> 2.16)
173174
selenium-devtools!
174175
selenium-webdriver!
175-
steep (~> 1.6.0)
176+
steep (~> 1.5.0)
176177
webmock (~> 3.5)
177178
webrick (~> 1.7)
178179
yard (~> 0.9.11)
179180

180181
BUNDLED WITH
181-
2.4.10
182+
2.3.11

rb/Steepfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
target :lib do
24
signature 'sig' # Signature directory
35
check 'lib' # Directory name

rb/lib/selenium/webdriver/support/event_firing_bridge.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ def dispatch(name, *args)
120120
returned
121121
end
122122

123-
def method_missing(meth, *args, &blk) # rubocop:disable Style/MissingRespondToMissing
124-
@delegate.__send__(meth, *args, &blk)
123+
def method_missing(meth, ...) # rubocop:disable Style/MissingRespondToMissing
124+
@delegate.__send__(meth, ...)
125125
end
126126
end # EventFiringBridge
127127
end # Support

rb/spec/integration/selenium/webdriver/driver_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ module WebDriver
3131
expect(caps.browser_version).to match(/^\d\d\d?\./)
3232
expect(caps.platform_name).not_to be_nil
3333

34-
expect(caps.accept_insecure_certs).to be == (caps.browser_name == 'firefox')
35-
expect(caps.page_load_strategy).to be == 'normal'
34+
expect(caps.accept_insecure_certs).to eq(caps.browser_name == 'firefox')
35+
expect(caps.page_load_strategy).to eq 'normal'
3636
expect(caps.implicit_timeout).to be_zero
37-
expect(caps.page_load_timeout).to be == 300000
38-
expect(caps.script_timeout).to be == 30000
37+
expect(caps.page_load_timeout).to eq 300000
38+
expect(caps.script_timeout).to eq 30000
3939
end
4040
end
4141

rb/spec/integration/selenium/webdriver/spec_support/helpers.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ def driver
2525
GlobalTestEnv.driver_instance
2626
end
2727

28-
def reset_driver!(**opts, &block)
29-
GlobalTestEnv.reset_driver!(**opts, &block)
28+
def reset_driver!(...)
29+
GlobalTestEnv.reset_driver!(...)
3030
end
3131

3232
def quit_driver
3333
GlobalTestEnv.quit_driver
3434
end
3535

36-
def create_driver!(**opts, &block)
37-
GlobalTestEnv.create_driver!(**opts, &block)
36+
def create_driver!(...)
37+
GlobalTestEnv.create_driver!(...)
3838
end
3939

4040
def url_for(filename)

rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ def browser
5757
end
5858
end
5959

60-
def driver_instance(**opts, &block)
61-
@driver_instance || create_driver!(**opts, &block)
60+
def driver_instance(...)
61+
@driver_instance || create_driver!(...)
6262
end
6363

6464
def reset_driver!(time: 0, **opts, &block)

rb/spec/unit/selenium/webdriver/common/selenium_manager_spec.rb

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,15 @@ def stub_binary(binary)
4343
it 'detects Mac' do
4444
stub_binary('/macos/selenium-manager')
4545
allow(Platform).to receive(:assert_file)
46-
allow(Platform).to receive(:windows?).and_return(false)
47-
allow(Platform).to receive(:mac?).and_return(true)
46+
allow(Platform).to receive_messages(windows?: false, mac?: true)
4847

4948
expect(described_class.send(:binary)).to match(%r{/macos/selenium-manager$})
5049
end
5150

5251
it 'detects Linux' do
5352
stub_binary('/linux/selenium-manager')
5453
allow(Platform).to receive(:assert_file)
55-
allow(Platform).to receive(:windows?).and_return(false)
56-
allow(Platform).to receive(:mac?).and_return(false)
57-
allow(Platform).to receive(:linux?).and_return(true)
54+
allow(Platform).to receive_messages(windows?: false, mac?: false, linux?: true)
5855

5956
expect(described_class.send(:binary)).to match(%r{/linux/selenium-manager$})
6057
end
@@ -78,8 +75,8 @@ def stub_binary(binary)
7875

7976
describe 'self.driver_path' do
8077
it 'determines browser name by default' do
81-
allow(described_class).to receive(:run).and_return('browser_path' => '', 'driver_path' => '')
82-
allow(described_class).to receive(:binary).and_return('selenium-manager')
78+
allow(described_class).to receive_messages(run: {'browser_path' => '', 'driver_path' => ''},
79+
binary: 'selenium-manager')
8380
allow(Platform).to receive(:assert_executable)
8481

8582
described_class.driver_path(Options.chrome)
@@ -89,8 +86,8 @@ def stub_binary(binary)
8986
end
9087

9188
it 'uses browser version if specified' do
92-
allow(described_class).to receive(:run).and_return('browser_path' => '', 'driver_path' => '')
93-
allow(described_class).to receive(:binary).and_return('selenium-manager')
89+
allow(described_class).to receive_messages(run: {'browser_path' => '', 'driver_path' => ''},
90+
binary: 'selenium-manager')
9491
allow(Platform).to receive(:assert_executable)
9592
options = Options.chrome(browser_version: 1)
9693

@@ -104,8 +101,8 @@ def stub_binary(binary)
104101

105102
it 'uses proxy if specified' do
106103
proxy = Selenium::WebDriver::Proxy.new(ssl: 'proxy')
107-
allow(described_class).to receive(:run).and_return('browser_path' => '', 'driver_path' => '')
108-
allow(described_class).to receive(:binary).and_return('selenium-manager')
104+
allow(described_class).to receive_messages(run: {'browser_path' => '', 'driver_path' => ''},
105+
binary: 'selenium-manager')
109106
allow(Platform).to receive(:assert_executable)
110107
options = Options.chrome(proxy: proxy)
111108

@@ -118,8 +115,8 @@ def stub_binary(binary)
118115
end
119116

120117
it 'uses browser location if specified' do
121-
allow(described_class).to receive(:run).and_return('browser_path' => '', 'driver_path' => '')
122-
allow(described_class).to receive(:binary).and_return('selenium-manager')
118+
allow(described_class).to receive_messages(run: {'browser_path' => '', 'driver_path' => ''},
119+
binary: 'selenium-manager')
123120
allow(Platform).to receive(:assert_executable)
124121
options = Options.chrome(binary: '/path/to/browser')
125122

@@ -130,8 +127,8 @@ def stub_binary(binary)
130127
end
131128

132129
it 'properly escapes plain spaces in browser location' do
133-
allow(described_class).to receive(:run).and_return('browser_path' => 'a', 'driver_path' => '')
134-
allow(described_class).to receive(:binary).and_return('selenium-manager')
130+
allow(described_class).to receive_messages(run: {'browser_path' => 'a', 'driver_path' => ''},
131+
binary: 'selenium-manager')
135132
allow(Platform).to receive(:assert_executable)
136133
options = Options.chrome(binary: '/path to/the/browser')
137134

@@ -143,8 +140,8 @@ def stub_binary(binary)
143140
end
144141

145142
it 'sets binary location on options' do
146-
allow(described_class).to receive(:run).and_return('browser_path' => 'foo', 'driver_path' => '')
147-
allow(described_class).to receive(:binary).and_return('selenium-manager')
143+
allow(described_class).to receive_messages(run: {'browser_path' => 'foo', 'driver_path' => ''},
144+
binary: 'selenium-manager')
148145
allow(Platform).to receive(:assert_executable)
149146
options = Options.chrome
150147

0 commit comments

Comments
 (0)