Skip to content

Commit 5e39f36

Browse files
committed
[rb] redundant — asserting executable also asserts file
1 parent 2ea04c5 commit 5e39f36

File tree

11 files changed

+20
-21
lines changed

11 files changed

+20
-21
lines changed

rb/lib/selenium/webdriver/common/driver_finder.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ def self.path(options, klass)
3131
end
3232

3333
begin
34-
Platform.assert_file(path)
3534
Platform.assert_executable(path)
3635
rescue TypeError
3736
raise Error::NoSuchDriverError, "Unable to locate or obtain #{klass::EXECUTABLE}"

rb/spec/unit/selenium/webdriver/chrome/driver_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def expect_request(body: nil, endpoint: nil)
6363
end
6464

6565
it 'does not require any parameters' do
66-
allow(SeleniumManager).to receive(:driver_path).and_return('path')
66+
allow(DriverFinder).to receive(:path).and_return('path')
6767
allow(Platform).to receive(:assert_file)
6868
allow(Platform).to receive(:assert_executable)
6969

@@ -73,7 +73,7 @@ def expect_request(body: nil, endpoint: nil)
7373
end
7474

7575
it 'accepts provided Options as sole parameter' do
76-
allow(SeleniumManager).to receive(:driver_path).and_return('path')
76+
allow(DriverFinder).to receive(:path).and_return('path')
7777
allow(Platform).to receive(:assert_file)
7878
allow(Platform).to receive(:assert_executable)
7979

rb/spec/unit/selenium/webdriver/chrome/service_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ module Chrome
9797
end
9898

9999
it 'is created when :url is not provided' do
100-
allow(SeleniumManager).to receive(:driver_path).and_return('path')
100+
allow(DriverFinder).to receive(:path).and_return('path')
101101
allow(Platform).to receive(:assert_file)
102102
allow(Platform).to receive(:assert_executable)
103103
allow(described_class).to receive(:new).and_return(service)
@@ -107,7 +107,7 @@ module Chrome
107107
end
108108

109109
it 'accepts :service without creating a new instance' do
110-
allow(SeleniumManager).to receive(:driver_path).and_return('path')
110+
allow(DriverFinder).to receive(:path).and_return('path')
111111
allow(Platform).to receive(:assert_file)
112112
allow(Platform).to receive(:assert_executable)
113113
allow(described_class).to receive(:new)

rb/spec/unit/selenium/webdriver/edge/driver_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def expect_request(body: nil, endpoint: nil)
6363
end
6464

6565
it 'does not require any parameters' do
66-
allow(SeleniumManager).to receive(:driver_path).and_return('path')
66+
allow(DriverFinder).to receive(:path).and_return('path')
6767
allow(Platform).to receive(:assert_file)
6868
allow(Platform).to receive(:assert_executable)
6969
expect_request
@@ -72,7 +72,7 @@ def expect_request(body: nil, endpoint: nil)
7272
end
7373

7474
it 'accepts provided Options as sole parameter' do
75-
allow(SeleniumManager).to receive(:driver_path).and_return('path')
75+
allow(DriverFinder).to receive(:path).and_return('path')
7676
allow(Platform).to receive(:assert_file)
7777
allow(Platform).to receive(:assert_executable)
7878
opts = {args: ['-f']}
@@ -82,7 +82,7 @@ def expect_request(body: nil, endpoint: nil)
8282
end
8383

8484
it 'raises an ArgumentError if parameter is not recognized' do
85-
allow(SeleniumManager).to receive(:driver_path).and_return('path')
85+
allow(DriverFinder).to receive(:path).and_return('path')
8686
allow(Platform).to receive(:assert_file)
8787
allow(Platform).to receive(:assert_executable)
8888
msg = 'unknown keyword: :invalid'

rb/spec/unit/selenium/webdriver/edge/service_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ module Edge
8888
end
8989

9090
it 'is created when :url is not provided' do
91-
allow(SeleniumManager).to receive(:driver_path).and_return('path')
91+
allow(DriverFinder).to receive(:path).and_return('path')
9292
allow(Platform).to receive(:assert_file)
9393
allow(Platform).to receive(:assert_executable)
9494
allow(described_class).to receive(:new).and_return(service)
@@ -98,7 +98,7 @@ module Edge
9898
end
9999

100100
it 'accepts :service without creating a new instance' do
101-
allow(SeleniumManager).to receive(:driver_path).and_return('path')
101+
allow(DriverFinder).to receive(:path).and_return('path')
102102
allow(Platform).to receive(:assert_file)
103103
allow(Platform).to receive(:assert_executable)
104104
allow(described_class).to receive(:new)

rb/spec/unit/selenium/webdriver/firefox/driver_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def expect_request(body: nil, endpoint: nil)
6666
end
6767

6868
it 'does not require any parameters' do
69-
allow(SeleniumManager).to receive(:driver_path).and_return('path')
69+
allow(DriverFinder).to receive(:path).and_return('path')
7070
allow(Platform).to receive(:assert_file)
7171
allow(Platform).to receive(:assert_executable)
7272
expect_request
@@ -75,7 +75,7 @@ def expect_request(body: nil, endpoint: nil)
7575
end
7676

7777
it 'accepts provided Options as sole parameter' do
78-
allow(SeleniumManager).to receive(:driver_path).and_return('path')
78+
allow(DriverFinder).to receive(:path).and_return('path')
7979
allow(Platform).to receive(:assert_file)
8080
allow(Platform).to receive(:assert_executable)
8181

rb/spec/unit/selenium/webdriver/firefox/service_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ module Firefox
8282
end
8383

8484
it 'is created when :url is not provided' do
85-
allow(SeleniumManager).to receive(:driver_path).and_return('path')
85+
allow(DriverFinder).to receive(:path).and_return('path')
8686
allow(Platform).to receive(:assert_file)
8787
allow(Platform).to receive(:assert_executable)
8888
allow(described_class).to receive(:new).and_return(service)
@@ -93,7 +93,7 @@ module Firefox
9393
end
9494

9595
it 'accepts :service without creating a new instance' do
96-
allow(SeleniumManager).to receive(:driver_path).and_return('path')
96+
allow(DriverFinder).to receive(:path).and_return('path')
9797
allow(Platform).to receive(:assert_file)
9898
allow(Platform).to receive(:assert_executable)
9999
allow(described_class).to receive(:new)

rb/spec/unit/selenium/webdriver/ie/driver_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def expect_request(body: nil, endpoint: nil)
6464
end
6565

6666
it 'does not require any parameters' do
67-
allow(SeleniumManager).to receive(:driver_path).and_return('path')
67+
allow(DriverFinder).to receive(:path).and_return('path')
6868
allow(Platform).to receive(:assert_file)
6969
allow(Platform).to receive(:assert_executable)
7070
expect_request
@@ -73,7 +73,7 @@ def expect_request(body: nil, endpoint: nil)
7373
end
7474

7575
it 'accepts provided Options as sole parameter' do
76-
allow(SeleniumManager).to receive(:driver_path).and_return('path')
76+
allow(DriverFinder).to receive(:path).and_return('path')
7777
allow(Platform).to receive(:assert_file)
7878
allow(Platform).to receive(:assert_executable)
7979
opts = {args: ['-f']}

rb/spec/unit/selenium/webdriver/ie/service_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ module IE
9595
end
9696

9797
it 'accepts :service without creating a new instance' do
98-
allow(SeleniumManager).to receive(:driver_path).and_return('path')
98+
allow(DriverFinder).to receive(:path).and_return('path')
9999
allow(Platform).to receive(:assert_file)
100100
allow(Platform).to receive(:assert_executable)
101101
allow(described_class).to receive(:new)

rb/spec/unit/selenium/webdriver/safari/driver_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def expect_request(body: nil, endpoint: nil)
6363
end
6464

6565
it 'does not require any parameters' do
66-
allow(SeleniumManager).to receive(:driver_path).and_return('/path/to/safaridriver')
66+
allow(DriverFinder).to receive(:path).and_return('/path/to/safaridriver')
6767
allow(Platform).to receive(:assert_file)
6868
allow(Platform).to receive(:assert_executable)
6969
expect_request
@@ -72,7 +72,7 @@ def expect_request(body: nil, endpoint: nil)
7272
end
7373

7474
it 'accepts provided Options as sole parameter' do
75-
allow(SeleniumManager).to receive(:driver_path).and_return('/path/to/safaridriver')
75+
allow(DriverFinder).to receive(:path).and_return('/path/to/safaridriver')
7676
allow(Platform).to receive(:assert_file)
7777
allow(Platform).to receive(:assert_executable)
7878
opts = {automatic_inspection: true}

0 commit comments

Comments
 (0)