Skip to content

Commit ebe1ec1

Browse files
committed
[rb] Looks like I added comments that this was deprecated 4 years ago, but never actually added deprecation warnings to the code
Probably fine to just delete all of this, but I'll mark it deprecated to be safe
1 parent 79035ba commit ebe1ec1

8 files changed

Lines changed: 23 additions & 17 deletions

File tree

rb/lib/selenium/webdriver/chrome/service.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class Service < WebDriver::Service
3232

3333
private
3434

35-
# NOTE: This processing is deprecated
3635
def extract_service_args(driver_opts)
3736
driver_args = super
3837
driver_opts = driver_opts.dup

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ def shutdown_supported
9090
protected
9191

9292
def extract_service_args(driver_opts)
93+
WebDriver.logger.deprecate("initializing Service class with :args using Hash",
94+
":args parameter with an Array of String values",
95+
id: :driver_opts)
9396
driver_opts.key?(:args) ? driver_opts.delete(:args) : []
9497
end
9598

rb/lib/selenium/webdriver/firefox/service.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class Service < WebDriver::Service
3232

3333
private
3434

35-
# NOTE: This processing is deprecated
3635
def extract_service_args(driver_opts)
3736
driver_args = super
3837
driver_opts = driver_opts.dup

rb/lib/selenium/webdriver/ie/service.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class Service < WebDriver::Service
3232

3333
private
3434

35-
# NOTE: This processing is deprecated
3635
def extract_service_args(driver_opts)
3736
driver_args = super
3837
driver_opts = driver_opts.dup

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,15 @@ module WebDriver
8888
expect(service.extra_args).to eq ['--foo', '--bar']
8989
end
9090

91-
# This is deprecated behavior
9291
it 'uses args when passed in as a Hash' do
9392
allow(Platform).to receive(:find_binary).and_return(service_path)
9493

95-
service = Service.chrome(args: {log_path: '/path/to/log',
96-
verbose: true})
94+
expect {
95+
service = Service.chrome(args: {log_path: '/path/to/log',
96+
verbose: true})
9797

98-
expect(service.extra_args).to eq ['--log-path=/path/to/log', '--verbose']
98+
expect(service.extra_args).to eq ['--log-path=/path/to/log', '--verbose']
99+
}.to have_deprecated(:driver_opts)
99100
end
100101
end
101102

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,12 @@ module WebDriver
9595
it 'uses args when passed in as a Hash' do
9696
allow(Platform).to receive(:find_binary).and_return(service_path)
9797

98-
service = Service.edge(args: {log_path: '/path/to/log',
99-
verbose: true})
98+
expect {
99+
service = Service.edge(args: {log_path: '/path/to/log',
100+
verbose: true})
100101

101-
expect(service.extra_args).to eq ['--log-path=/path/to/log', '--verbose']
102+
expect(service.extra_args).to eq ['--log-path=/path/to/log', '--verbose']
103+
}.to have_deprecated(:driver_opts)
102104
end
103105
end
104106

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,15 @@ module WebDriver
8484
expect(service.extra_args).to eq ['--foo', '--bar']
8585
end
8686

87-
# This is deprecated behavior
8887
it 'uses args when passed in as a Hash' do
8988
allow(Platform).to receive(:find_binary).and_return(service_path)
9089

91-
service = Service.firefox(args: {log: '/path/to/log',
92-
marionette_port: 4})
90+
expect {
91+
service = Service.firefox(args: {log: '/path/to/log',
92+
marionette_port: 4})
9393

94-
expect(service.extra_args).to eq ['--log=/path/to/log', '--marionette-port=4']
94+
expect(service.extra_args).to eq ['--log=/path/to/log', '--marionette-port=4']
95+
}.to have_deprecated(:driver_opts)
9596
end
9697
end
9798

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,12 @@ module WebDriver
8989
it 'uses args when passed in as a Hash' do
9090
allow(Platform).to receive(:find_binary).and_return(service_path)
9191

92-
service = Service.ie(args: {log_file: '/path/to/log',
93-
silent: true})
92+
expect {
93+
service = Service.ie(args: {log_file: '/path/to/log',
94+
silent: true})
9495

95-
expect(service.extra_args).to eq ['--log-file=/path/to/log', '--silent']
96+
expect(service.extra_args).to eq ['--log-file=/path/to/log', '--silent']
97+
}.to have_deprecated(:driver_opts)
9698
end
9799
end
98100

0 commit comments

Comments
 (0)