@@ -143,14 +143,28 @@ module Edge
143143
144144 describe '#add_option' do
145145 it 'adds an option with ordered pairs' do
146- options . add_option ( :foo , 'bar' )
146+ expect {
147+ options . add_option ( :foo , 'bar' )
148+ } . to have_deprecated ( :add_option )
147149 expect ( options . instance_variable_get ( :@options ) [ :foo ] ) . to eq ( 'bar' )
148150 end
149151
150152 it 'adds an option with Hash' do
151- options . add_option ( foo : 'bar' )
153+ expect {
154+ options . add_option ( foo : 'bar' )
155+ } . to have_deprecated ( :add_option )
152156 expect ( options . instance_variable_get ( :@options ) [ :foo ] ) . to eq ( 'bar' )
153157 end
158+
159+ it 'adds vendor namespaced options with ordered pairs' do
160+ options . add_option ( 'foo:bar' , { bar : 'foo' } )
161+ expect ( options . instance_variable_get ( :@options ) [ 'foo:bar' ] ) . to eq ( { bar : 'foo' } )
162+ end
163+
164+ it 'adds vendor namespaced options with Hash' do
165+ options . add_option ( 'foo:bar' => { bar : 'foo' } )
166+ expect ( options . instance_variable_get ( :@options ) [ 'foo:bar' ] ) . to eq ( { bar : 'foo' } )
167+ end
154168 end
155169
156170 describe '#add_preference' do
@@ -205,18 +219,24 @@ module Edge
205219 end
206220
207221 it 'raises error when w3c is false' do
208- options . add_option ( :w3c , false )
222+ expect {
223+ options . add_option ( :w3c , false )
224+ } . to have_deprecated ( :add_option )
209225 expect { options . as_json } . to raise_error ( Error ::InvalidArgumentError )
210226 end
211227
212228 it 'raises error when w3c is true' do
213229 msg = /WARN Selenium \[ :w3c\] /
214- options . add_option ( :w3c , true )
230+ expect {
231+ options . add_option ( :w3c , true )
232+ } . to have_deprecated ( :add_option )
215233 expect { options . as_json } . to output ( msg ) . to_stdout_from_any_process
216234 end
217235
218236 it 'returns added options' do
219- options . add_option ( :foo , 'bar' )
237+ expect {
238+ options . add_option ( :foo , 'bar' )
239+ } . to have_deprecated ( :add_option )
220240 options . add_option ( 'foo:bar' , { foo : 'bar' } )
221241 expect ( options . as_json ) . to eq ( 'browserName' => 'MicrosoftEdge' ,
222242 'foo:bar' => { 'foo' => 'bar' } ,
0 commit comments