@@ -31,6 +31,7 @@ module WebDriver
31
31
32
32
it 'accepts path set on class as String' do
33
33
allow ( SeleniumManager ) . to receive ( :driver_path )
34
+ allow ( Platform ) . to receive ( :assert_file )
34
35
allow ( Platform ) . to receive ( :assert_executable )
35
36
36
37
service . driver_path = 'path'
@@ -42,6 +43,7 @@ module WebDriver
42
43
43
44
it 'accepts path set on class as proc' do
44
45
allow ( SeleniumManager ) . to receive ( :driver_path )
46
+ allow ( Platform ) . to receive ( :assert_file )
45
47
allow ( Platform ) . to receive ( :assert_executable )
46
48
47
49
service . driver_path = proc { 'path' }
@@ -54,6 +56,7 @@ module WebDriver
54
56
55
57
it 'uses path from PATH' do
56
58
allow ( SeleniumManager ) . to receive ( :driver_path )
59
+ allow ( Platform ) . to receive ( :assert_file )
57
60
allow ( Platform ) . to receive ( :assert_executable )
58
61
allow ( Platform ) . to receive ( :find_binary ) . and_return ( 'path' )
59
62
@@ -68,11 +71,8 @@ module WebDriver
68
71
allow ( SeleniumManager ) . to receive ( :driver_path ) . and_raise ( Error ::WebDriverError )
69
72
70
73
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} )
76
76
end
77
77
end
78
78
@@ -85,6 +85,7 @@ module WebDriver
85
85
86
86
it 'accepts path set on class as String' do
87
87
allow ( SeleniumManager ) . to receive ( :driver_path )
88
+ allow ( Platform ) . to receive ( :assert_file )
88
89
allow ( Platform ) . to receive ( :assert_executable )
89
90
90
91
service . driver_path = 'path'
@@ -96,6 +97,7 @@ module WebDriver
96
97
97
98
it 'accepts path set on class as proc' do
98
99
allow ( SeleniumManager ) . to receive ( :driver_path )
100
+ allow ( Platform ) . to receive ( :assert_file )
99
101
allow ( Platform ) . to receive ( :assert_executable )
100
102
101
103
service . driver_path = proc { 'path' }
@@ -108,6 +110,7 @@ module WebDriver
108
110
109
111
it 'uses path from PATH' do
110
112
allow ( SeleniumManager ) . to receive ( :driver_path )
113
+ allow ( Platform ) . to receive ( :assert_file )
111
114
allow ( Platform ) . to receive ( :assert_executable )
112
115
allow ( Platform ) . to receive ( :find_binary ) . and_return ( 'path' )
113
116
@@ -122,11 +125,8 @@ module WebDriver
122
125
allow ( SeleniumManager ) . to receive ( :driver_path ) . and_raise ( Error ::WebDriverError )
123
126
124
127
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} )
130
130
end
131
131
end
132
132
@@ -139,6 +139,7 @@ module WebDriver
139
139
140
140
it 'accepts path set on class as String' do
141
141
allow ( SeleniumManager ) . to receive ( :driver_path )
142
+ allow ( Platform ) . to receive ( :assert_file )
142
143
allow ( Platform ) . to receive ( :assert_executable )
143
144
144
145
service . driver_path = 'path'
@@ -150,6 +151,7 @@ module WebDriver
150
151
151
152
it 'accepts path set on class as proc' do
152
153
allow ( SeleniumManager ) . to receive ( :driver_path )
154
+ allow ( Platform ) . to receive ( :assert_file )
153
155
allow ( Platform ) . to receive ( :assert_executable )
154
156
155
157
service . driver_path = proc { 'path' }
@@ -162,6 +164,7 @@ module WebDriver
162
164
163
165
it 'uses path from PATH' do
164
166
allow ( SeleniumManager ) . to receive ( :driver_path )
167
+ allow ( Platform ) . to receive ( :assert_file )
165
168
allow ( Platform ) . to receive ( :assert_executable )
166
169
allow ( Platform ) . to receive ( :find_binary ) . and_return ( 'path' )
167
170
@@ -176,11 +179,8 @@ module WebDriver
176
179
allow ( SeleniumManager ) . to receive ( :driver_path ) . and_raise ( Error ::WebDriverError )
177
180
178
181
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} )
184
184
end
185
185
end
186
186
@@ -193,6 +193,7 @@ module WebDriver
193
193
194
194
it 'accepts path set on class as String' do
195
195
allow ( SeleniumManager ) . to receive ( :driver_path )
196
+ allow ( Platform ) . to receive ( :assert_file )
196
197
allow ( Platform ) . to receive ( :assert_executable )
197
198
198
199
service . driver_path = 'path'
@@ -204,6 +205,7 @@ module WebDriver
204
205
205
206
it 'accepts path set on class as proc' do
206
207
allow ( SeleniumManager ) . to receive ( :driver_path )
208
+ allow ( Platform ) . to receive ( :assert_file )
207
209
allow ( Platform ) . to receive ( :assert_executable )
208
210
209
211
service . driver_path = proc { 'path' }
@@ -216,6 +218,7 @@ module WebDriver
216
218
217
219
it 'uses path from PATH' do
218
220
allow ( SeleniumManager ) . to receive ( :driver_path )
221
+ allow ( Platform ) . to receive ( :assert_file )
219
222
allow ( Platform ) . to receive ( :assert_executable )
220
223
allow ( Platform ) . to receive ( :find_binary ) . and_return ( 'path' )
221
224
@@ -230,11 +233,8 @@ module WebDriver
230
233
allow ( SeleniumManager ) . to receive ( :driver_path ) . and_raise ( Error ::WebDriverError )
231
234
232
235
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} )
238
238
end
239
239
end
240
240
@@ -247,6 +247,7 @@ module WebDriver
247
247
248
248
it 'accepts path set on class as String' do
249
249
allow ( SeleniumManager ) . to receive ( :driver_path )
250
+ allow ( Platform ) . to receive ( :assert_file )
250
251
allow ( Platform ) . to receive ( :assert_executable )
251
252
252
253
service . driver_path = 'path'
@@ -258,6 +259,7 @@ module WebDriver
258
259
259
260
it 'accepts path set on class as proc' do
260
261
allow ( SeleniumManager ) . to receive ( :driver_path )
262
+ allow ( Platform ) . to receive ( :assert_file )
261
263
allow ( Platform ) . to receive ( :assert_executable )
262
264
263
265
service . driver_path = proc { 'path' }
@@ -270,6 +272,7 @@ module WebDriver
270
272
271
273
it 'uses path from PATH' do
272
274
allow ( SeleniumManager ) . to receive ( :driver_path )
275
+ allow ( Platform ) . to receive ( :assert_file )
273
276
allow ( Platform ) . to receive ( :assert_executable )
274
277
allow ( Platform ) . to receive ( :find_binary ) . and_return ( 'path' )
275
278
@@ -284,11 +287,8 @@ module WebDriver
284
287
allow ( SeleniumManager ) . to receive ( :driver_path ) . and_raise ( Error ::WebDriverError )
285
288
286
289
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} )
292
292
end
293
293
end
294
294
end
0 commit comments