@@ -31,6 +31,7 @@ module WebDriver
3131
3232 it 'accepts path set on class as String' do
3333 allow ( SeleniumManager ) . to receive ( :driver_path )
34+ allow ( Platform ) . to receive ( :assert_file )
3435 allow ( Platform ) . to receive ( :assert_executable )
3536
3637 service . driver_path = 'path'
@@ -42,6 +43,7 @@ module WebDriver
4243
4344 it 'accepts path set on class as proc' do
4445 allow ( SeleniumManager ) . to receive ( :driver_path )
46+ allow ( Platform ) . to receive ( :assert_file )
4547 allow ( Platform ) . to receive ( :assert_executable )
4648
4749 service . driver_path = proc { 'path' }
@@ -54,6 +56,7 @@ module WebDriver
5456
5557 it 'uses path from PATH' do
5658 allow ( SeleniumManager ) . to receive ( :driver_path )
59+ allow ( Platform ) . to receive ( :assert_file )
5760 allow ( Platform ) . to receive ( :assert_executable )
5861 allow ( Platform ) . to receive ( :find_binary ) . and_return ( 'path' )
5962
@@ -68,11 +71,8 @@ module WebDriver
6871 allow ( SeleniumManager ) . to receive ( :driver_path ) . and_raise ( Error ::WebDriverError )
6972
7073 expect {
71- expect {
72- described_class . path ( options , service )
73- } . to raise_error ( WebDriver ::Error ::WebDriverError ,
74- /Unable to locate the #{ driver } executable; for more information on how to install/ )
75- } . to have_warning ( :selenium_manager )
74+ described_class . path ( options , service )
75+ } . to raise_error ( WebDriver ::Error ::NoSuchDriverError , %r{errors/driver_location} )
7676 end
7777 end
7878
@@ -85,6 +85,7 @@ module WebDriver
8585
8686 it 'accepts path set on class as String' do
8787 allow ( SeleniumManager ) . to receive ( :driver_path )
88+ allow ( Platform ) . to receive ( :assert_file )
8889 allow ( Platform ) . to receive ( :assert_executable )
8990
9091 service . driver_path = 'path'
@@ -96,6 +97,7 @@ module WebDriver
9697
9798 it 'accepts path set on class as proc' do
9899 allow ( SeleniumManager ) . to receive ( :driver_path )
100+ allow ( Platform ) . to receive ( :assert_file )
99101 allow ( Platform ) . to receive ( :assert_executable )
100102
101103 service . driver_path = proc { 'path' }
@@ -108,6 +110,7 @@ module WebDriver
108110
109111 it 'uses path from PATH' do
110112 allow ( SeleniumManager ) . to receive ( :driver_path )
113+ allow ( Platform ) . to receive ( :assert_file )
111114 allow ( Platform ) . to receive ( :assert_executable )
112115 allow ( Platform ) . to receive ( :find_binary ) . and_return ( 'path' )
113116
@@ -122,11 +125,8 @@ module WebDriver
122125 allow ( SeleniumManager ) . to receive ( :driver_path ) . and_raise ( Error ::WebDriverError )
123126
124127 expect {
125- expect {
126- described_class . path ( options , service )
127- } . to raise_error ( WebDriver ::Error ::WebDriverError ,
128- /Unable to locate the #{ driver } executable; for more information on how to install/ )
129- } . to have_warning ( :selenium_manager )
128+ described_class . path ( options , service )
129+ } . to raise_error ( WebDriver ::Error ::NoSuchDriverError , %r{errors/driver_location} )
130130 end
131131 end
132132
@@ -139,6 +139,7 @@ module WebDriver
139139
140140 it 'accepts path set on class as String' do
141141 allow ( SeleniumManager ) . to receive ( :driver_path )
142+ allow ( Platform ) . to receive ( :assert_file )
142143 allow ( Platform ) . to receive ( :assert_executable )
143144
144145 service . driver_path = 'path'
@@ -150,6 +151,7 @@ module WebDriver
150151
151152 it 'accepts path set on class as proc' do
152153 allow ( SeleniumManager ) . to receive ( :driver_path )
154+ allow ( Platform ) . to receive ( :assert_file )
153155 allow ( Platform ) . to receive ( :assert_executable )
154156
155157 service . driver_path = proc { 'path' }
@@ -162,6 +164,7 @@ module WebDriver
162164
163165 it 'uses path from PATH' do
164166 allow ( SeleniumManager ) . to receive ( :driver_path )
167+ allow ( Platform ) . to receive ( :assert_file )
165168 allow ( Platform ) . to receive ( :assert_executable )
166169 allow ( Platform ) . to receive ( :find_binary ) . and_return ( 'path' )
167170
@@ -176,11 +179,8 @@ module WebDriver
176179 allow ( SeleniumManager ) . to receive ( :driver_path ) . and_raise ( Error ::WebDriverError )
177180
178181 expect {
179- expect {
180- described_class . path ( options , service )
181- } . to raise_error ( WebDriver ::Error ::WebDriverError ,
182- /Unable to locate the #{ driver } executable; for more information on how to install/ )
183- } . to have_warning ( :selenium_manager )
182+ described_class . path ( options , service )
183+ } . to raise_error ( WebDriver ::Error ::NoSuchDriverError , %r{errors/driver_location} )
184184 end
185185 end
186186
@@ -193,6 +193,7 @@ module WebDriver
193193
194194 it 'accepts path set on class as String' do
195195 allow ( SeleniumManager ) . to receive ( :driver_path )
196+ allow ( Platform ) . to receive ( :assert_file )
196197 allow ( Platform ) . to receive ( :assert_executable )
197198
198199 service . driver_path = 'path'
@@ -204,6 +205,7 @@ module WebDriver
204205
205206 it 'accepts path set on class as proc' do
206207 allow ( SeleniumManager ) . to receive ( :driver_path )
208+ allow ( Platform ) . to receive ( :assert_file )
207209 allow ( Platform ) . to receive ( :assert_executable )
208210
209211 service . driver_path = proc { 'path' }
@@ -216,6 +218,7 @@ module WebDriver
216218
217219 it 'uses path from PATH' do
218220 allow ( SeleniumManager ) . to receive ( :driver_path )
221+ allow ( Platform ) . to receive ( :assert_file )
219222 allow ( Platform ) . to receive ( :assert_executable )
220223 allow ( Platform ) . to receive ( :find_binary ) . and_return ( 'path' )
221224
@@ -230,11 +233,8 @@ module WebDriver
230233 allow ( SeleniumManager ) . to receive ( :driver_path ) . and_raise ( Error ::WebDriverError )
231234
232235 expect {
233- expect {
234- described_class . path ( options , service )
235- } . to raise_error ( WebDriver ::Error ::WebDriverError ,
236- /Unable to locate the #{ driver } executable; for more information on how to install/ )
237- } . to have_warning ( :selenium_manager )
236+ described_class . path ( options , service )
237+ } . to raise_error ( WebDriver ::Error ::NoSuchDriverError , %r{errors/driver_location} )
238238 end
239239 end
240240
@@ -247,6 +247,7 @@ module WebDriver
247247
248248 it 'accepts path set on class as String' do
249249 allow ( SeleniumManager ) . to receive ( :driver_path )
250+ allow ( Platform ) . to receive ( :assert_file )
250251 allow ( Platform ) . to receive ( :assert_executable )
251252
252253 service . driver_path = 'path'
@@ -258,6 +259,7 @@ module WebDriver
258259
259260 it 'accepts path set on class as proc' do
260261 allow ( SeleniumManager ) . to receive ( :driver_path )
262+ allow ( Platform ) . to receive ( :assert_file )
261263 allow ( Platform ) . to receive ( :assert_executable )
262264
263265 service . driver_path = proc { 'path' }
@@ -270,6 +272,7 @@ module WebDriver
270272
271273 it 'uses path from PATH' do
272274 allow ( SeleniumManager ) . to receive ( :driver_path )
275+ allow ( Platform ) . to receive ( :assert_file )
273276 allow ( Platform ) . to receive ( :assert_executable )
274277 allow ( Platform ) . to receive ( :find_binary ) . and_return ( 'path' )
275278
@@ -284,11 +287,8 @@ module WebDriver
284287 allow ( SeleniumManager ) . to receive ( :driver_path ) . and_raise ( Error ::WebDriverError )
285288
286289 expect {
287- expect {
288- described_class . path ( options , service )
289- } . to raise_error ( WebDriver ::Error ::WebDriverError ,
290- /Unable to locate the #{ driver } executable; for more information on how to install/ )
291- } . to have_warning ( :selenium_manager )
290+ described_class . path ( options , service )
291+ } . to raise_error ( WebDriver ::Error ::NoSuchDriverError , %r{errors/driver_location} )
292292 end
293293 end
294294 end
0 commit comments