Skip to content

Commit f21e64b

Browse files
committed
[rb] fix things I've missed
1 parent 13ea716 commit f21e64b

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

rb/lib/selenium/webdriver/common/service.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def initialize(path: nil, port: nil, log: nil, args: nil)
8989
def launch
9090
@executable_path ||= begin
9191
default_options = WebDriver.const_get("#{self.class.name&.split('::')&.[](2)}::Options").new
92-
DriverFinder.result(default_options, self.class)[:driver_path]
92+
DriverFinder.new(default_options, self.class).driver_path
9393
end
9494
ServiceManager.new(self).tap(&:start)
9595
end

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,28 @@ module WebDriver
2424
describe DriverFinder do
2525
it 'class path accepts a String without calling Selenium Manager' do
2626
allow(Chrome::Service).to receive(:driver_path).and_return('path')
27-
allow(SeleniumManager).to receive(:result)
27+
allow(SeleniumManager).to receive(:binary_paths)
2828
allow(Platform).to receive(:assert_executable).with('path').and_return(true)
2929

3030
described_class.new(Options.chrome, Service.chrome).driver_path
3131

32-
expect(SeleniumManager).not_to have_received(:result)
32+
expect(SeleniumManager).not_to have_received(:binary_paths)
3333
expect(Platform).to have_received(:assert_executable).with('path')
3434
end
3535

3636
it 'class path accepts a proc without calling Selenium Manager' do
3737
allow(Chrome::Service).to receive(:driver_path).and_return(proc { 'path' })
38-
allow(SeleniumManager).to receive(:result)
38+
allow(SeleniumManager).to receive(:binary_paths)
3939
allow(Platform).to receive(:assert_executable).with('path').and_return(true)
4040

4141
described_class.new(Options.chrome, Service.chrome).driver_path
4242

43-
expect(SeleniumManager).not_to have_received(:result)
43+
expect(SeleniumManager).not_to have_received(:binary_paths)
4444
expect(Platform).to have_received(:assert_executable).with('path')
4545
end
4646

4747
it 'validates all returned files' do
48-
allow(SeleniumManager).to receive(:result).and_return({'browser_path' => '/path/to/browser',
48+
allow(SeleniumManager).to receive(:binary_paths).and_return({'browser_path' => '/path/to/browser',
4949
'driver_path' => '/path/to/driver'})
5050
allow(Platform).to receive(:assert_executable).with('/path/to/browser').and_return(true)
5151
allow(Platform).to receive(:assert_executable).with('/path/to/driver').and_return(true)
@@ -57,7 +57,7 @@ module WebDriver
5757
end
5858

5959
it 'wraps error with NoSuchDriverError' do
60-
allow(SeleniumManager).to receive(:result).and_raise(Error::WebDriverError, 'this error')
60+
allow(SeleniumManager).to receive(:binary_paths).and_raise(Error::WebDriverError, 'this error')
6161

6262
expect {
6363
expect {
@@ -68,7 +68,7 @@ module WebDriver
6868
end
6969

7070
it 'creates arguments' do
71-
allow(SeleniumManager).to receive(:result).and_return({'browser_path' => '/path/to/browser',
71+
allow(SeleniumManager).to receive(:binary_paths).and_return({'browser_path' => '/path/to/browser',
7272
'driver_path' => '/path/to/driver'})
7373
proxy = instance_double(Proxy, ssl: 'proxy')
7474
options = Options.chrome(browser_version: 'stable', proxy: proxy, binary: 'path/to/browser')
@@ -77,7 +77,7 @@ module WebDriver
7777

7878
described_class.new(options, Service.chrome).driver_path
7979

80-
expect(SeleniumManager).to have_received(:result).with('--browser',
80+
expect(SeleniumManager).to have_received(:binary_paths).with('--browser',
8181
options.browser_name,
8282
'--browser-version',
8383
options.browser_version,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ module WebDriver
9494
end
9595
end
9696

97-
describe '.results' do
97+
describe '.binary_paths' do
9898
it 'returns exact output from #run' do
9999
return_map = {}
100100
allow(described_class).to receive_messages(binary: 'binary', run: return_map)
101-
expect(described_class.result('something')).to eq(return_map)
101+
expect(described_class.binary_paths('something')).to eq(return_map)
102102
end
103103
end
104104
end

0 commit comments

Comments
 (0)