Skip to content

Commit 3a6b3be

Browse files
RustyNailp0deje
authored andcommitted
Fixed the code pointed out by rubocop.
Signed-off-by: Alex Rodionov <[email protected]>
1 parent 8137636 commit 3a6b3be

File tree

7 files changed

+9
-11
lines changed

7 files changed

+9
-11
lines changed

rb/lib/selenium/webdriver/common/html5/shared_web_storage.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def empty?
4040
def each
4141
return enum_for(:each) unless block_given?
4242

43-
keys.each do |k|
43+
keys.each do |k| # rubocop:disable Performance/HashEachMethods
4444
yield k, self[k]
4545
end
4646
end

rb/lib/selenium/webdriver/common/proxy.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Proxy
3737
socks_username: 'socksUsername',
3838
socks_password: 'socksPassword'}.freeze
3939

40-
ALLOWED.keys.each { |t| attr_reader t }
40+
ALLOWED.each_key { |t| attr_reader t }
4141

4242
def self.json_create(data)
4343
data['proxyType'] = data['proxyType'].downcase.to_sym

rb/lib/selenium/webdriver/firefox/profile.rb

-2
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,6 @@ def proxy=(proxy)
189189
else
190190
raise ArgumentError, "unsupported proxy type #{proxy.type}"
191191
end
192-
193-
proxy
194192
end
195193

196194
def encoded

rb/lib/selenium/webdriver/ie/options.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Options
4040
validate_cookie_document_type: 'ie.validateCookieDocumentType'
4141
}.freeze
4242

43-
CAPABILITIES.keys.each do |key|
43+
CAPABILITIES.each_key do |key|
4444
define_method key do
4545
@options[key]
4646
end

rb/lib/selenium/webdriver/remote/bridge.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def execute(command, opts = {}, command_hash = nil)
169169
end
170170

171171
def escaper
172-
@escaper ||= defined?(URI::Parser) ? URI::Parser.new : URI
172+
@escaper ||= defined?(URI::Parser) ? URI::DEFAULT_PARSER : URI
173173
end
174174

175175
def commands(command)

rb/lib/selenium/webdriver/remote/http/default.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module Remote
2424
module Http
2525
# @api private
2626
class Default < Common
27-
attr_accessor :proxy
27+
attr_writer :proxy
2828

2929
attr_accessor :open_timeout
3030
attr_accessor :read_timeout

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ module WebDriver
6161
path = Firefox::Binary.path
6262

6363
create_driver! do |driver|
64-
default_version = driver.capabilities.version
64+
@default_version = driver.capabilities.version
6565
expect { driver.capabilities.browser_version }.to_not raise_exception
6666
end
6767

6868
caps = Remote::Capabilities.firefox(firefox_options: {binary: ENV['ALT_FIREFOX_BINARY']})
6969
create_driver!(desired_capabilities: caps) do |driver|
70-
expect(driver.capabilities.version).to_not eql(default_version)
70+
expect(driver.capabilities.version).to_not eql(@default_version)
7171
expect { driver.capabilities.browser_version }.to_not raise_exception
7272
end
7373
ensure
@@ -82,14 +82,14 @@ module WebDriver
8282
path = Firefox::Binary.path
8383

8484
create_driver! do |driver|
85-
default_version = driver.capabilities.version
85+
@default_version = driver.capabilities.version
8686
expect { driver.capabilities.browser_version }.to_not raise_exception
8787
end
8888

8989
caps = Remote::Capabilities.firefox(firefox_options: {binary: ENV['ALT_FIREFOX_BINARY']},
9090
service_args: {binary: path})
9191
create_driver!(desired_capabilities: caps) do |driver|
92-
expect(driver.capabilities.version).to_not eql(default_version)
92+
expect(driver.capabilities.version).to_not eql(@default_version)
9393
expect { driver.capabilities.browser_version }.to_not raise_exception
9494
end
9595
ensure

0 commit comments

Comments
 (0)