Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
pujagani committed Jun 11, 2024
1 parent 08b39da commit 91aee8f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions rb/spec/unit/selenium/webdriver/firefox/driver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module Firefox
def expect_request(body: nil, endpoint: nil)
body = (body || {capabilities: {alwaysMatch: {acceptInsecureCerts: true,
browserName: 'firefox',
'moz:firefoxOptions': {'prefs': {'remote.active-protocols'=>3}},
'moz:firefoxOptions': {prefs: {'remote.active-protocols' => 3}},
'moz:debuggerAddress': true}}}).to_json
endpoint ||= "#{service_manager.uri}/session"
stub_request(:post, endpoint).with(body: body).to_return(valid_response)
Expand Down Expand Up @@ -79,7 +79,8 @@ def expect_request(body: nil, endpoint: nil)
opts = {args: ['-f']}
expect_request(body: {capabilities: {alwaysMatch: {acceptInsecureCerts: true,
browserName: 'firefox',
'moz:firefoxOptions': {args: ['-f'], 'prefs': {'remote.active-protocols'=>3}},
'moz:firefoxOptions': {args: ['-f'],
prefs: {'remote.active-protocols' => 3}},
'moz:debuggerAddress': true}}})
expect { described_class.new(options: Options.new(**opts)) }.not_to raise_exception
end
Expand Down
8 changes: 4 additions & 4 deletions rb/spec/unit/selenium/webdriver/firefox/options_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ module Firefox
options.add_preference('intl.accepted_languages', 'en-US')

prefs = options.as_json['moz:firefoxOptions']['prefs']
expected = {'intl.accepted_languages' => 'en-US', 'remote.active-protocols'=>3}
expected = {'intl.accepted_languages' => 'en-US', 'remote.active-protocols' => 3}
expect(prefs).to eq(expected)
end
end
Expand Down Expand Up @@ -185,7 +185,7 @@ module Firefox
it 'returns empty options by default' do
expect(options.as_json).to eq('browserName' => 'firefox',
'acceptInsecureCerts' => true,
'moz:firefoxOptions' => {'prefs'=>{'remote.active-protocols'=>3}},
'moz:firefoxOptions' => {'prefs' => {'remote.active-protocols' => 3}},
'moz:debuggerAddress' => true)
end

Expand All @@ -195,7 +195,7 @@ module Firefox
'browserName' => 'firefox',
'foo:bar' => {'foo' => 'bar'},
'moz:debuggerAddress' => true,
'moz:firefoxOptions' => {'prefs'=>{'remote.active-protocols'=>3}})
'moz:firefoxOptions' => {'prefs' => {'remote.active-protocols' => 3}})
end

it 'converts to a json hash' do
Expand Down Expand Up @@ -240,7 +240,7 @@ module Firefox
'moz:debuggerAddress' => true,
key => {'args' => %w[foo bar],
'binary' => '/foo/bar',
'prefs' => {'foo' => 'bar', 'remote.active-protocols'=>3},
'prefs' => {'foo' => 'bar', 'remote.active-protocols' => 3},
'env' => {'FOO' => 'bar'},
'profile' => 'encoded_profile',
'log' => {'level' => 'debug'},
Expand Down

0 comments on commit 91aee8f

Please sign in to comment.