Skip to content

Commit 0ecbd47

Browse files
authored
[rb] update syntax with rspec linter (#16498)
does not look like the rubocop-rspec linter is being run with our current bazel command
1 parent 229e299 commit 0ecbd47

File tree

4 files changed

+26
-24
lines changed

4 files changed

+26
-24
lines changed

rb/.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ RSpec/MultipleExpectations:
119119

120120
RSpec/NoExpectationExample:
121121
Exclude:
122-
- 'spec/integration/selenium/webdriver/guard_spec.rb'
122+
- 'spec/unit/selenium/webdriver/guards_spec.rb'
123123
- 'spec/integration/selenium/webdriver/takes_screenshot_spec.rb'
124124

125125
RSpec/MultipleMemoizedHelpers:

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
module Selenium
2323
module WebDriver
2424
module IE
25-
describe Service, {exclusive: [{bidi: false, reason: 'Not yet implemented with BiDi'}, {browser: :ie}],
26-
exclude: {driver: :remote}} do
27-
25+
describe Service,
26+
{exclude: {driver: :remote},
27+
exclusive: [{bidi: false, reason: 'Not yet implemented with BiDi'}, {browser: :ie}]} do
2828
let(:service) { described_class.new }
2929
let(:service_manager) { service.launch }
3030

rb/spec/integration/selenium/webdriver/safari/service_spec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
module Selenium
2323
module WebDriver
2424
module Safari
25-
describe Service, { exclusive: [{ bidi: false, reason: 'Not yet implemented with BiDi' }, { browser: :safari }],
26-
exclude: {driver: :remote}} do
25+
describe Service,
26+
{exclude: {driver: :remote},
27+
exclusive: [{bidi: false, reason: 'Not yet implemented with BiDi'}, {browser: :safari}]} do
2728
let(:service) { described_class.new }
2829
let(:service_manager) { service.launch }
2930

rb/spec/unit/selenium/webdriver/guards_spec.rb

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,79 +34,80 @@ module Support
3434

3535
context 'with single guard' do
3636
describe '#exclude' do
37-
it 'ignores an unrecognized guard parameter', invalid: { condition: :guarded } do
37+
it 'ignores an unrecognized guard parameter', invalid: {condition: :guarded} do
3838
# pass
3939
end
4040

41-
it 'skips without running', exclude: { condition: :guarded } do
41+
it 'skips without running', exclude: {condition: :guarded} do
4242
raise 'This code will not get executed so it will not fail'
4343
end
4444
end
4545

4646
describe '#flaky' do
47-
it 'skips without running', flaky: { condition: :guarded } do
47+
it 'skips without running', flaky: {condition: :guarded} do
4848
raise 'This code will not get executed so it will not fail'
4949
end
5050
end
5151

5252
describe '#exclusive' do
53-
it 'skips without running if it does not match', exclusive: { condition: :not_guarded } do
53+
it 'skips without running if it does not match', exclusive: {condition: :not_guarded} do
5454
raise 'This code will not get executed so it will not fail'
5555
end
5656

57-
it 'does not guard if it does match', exclusive: { condition: :guarded } do
57+
it 'does not guard if it does match', exclusive: {condition: :guarded} do
5858
# pass
5959
end
6060
end
6161

6262
describe '#only' do
63-
it 'guards when value does not match', only: { condition: :not_guarded } do
63+
it 'guards when value does not match', only: {condition: :not_guarded} do
6464
raise 'This code is executed but expected to fail'
6565
end
6666

67-
it 'does not guard when value matches', only: { condition: :guarded } do
67+
it 'does not guard when value matches', only: {condition: :guarded} do
6868
# pass
6969
end
7070
end
7171

7272
describe '#except' do
73-
it 'guards when value matches and test fails', except: { condition: :guarded } do
73+
it 'guards when value matches and test fails', except: {condition: :guarded} do
7474
raise 'This code is executed but expected to fail'
7575
end
7676

77-
it 'does not guard when value does not match and test passes', except: { condition: :not_guarded } do
77+
it 'does not guard when value does not match and test passes', except: {condition: :not_guarded} do
7878
# pass
7979
end
8080
end
8181
end
8282

8383
context 'when multiple guards' do
84-
it 'guards if neither only nor except match and test fails', except: { condition: :not_guarded },
85-
only: { condition: :not_guarded } do
84+
it 'guards if neither only nor except match and test fails', except: {condition: :not_guarded},
85+
only: {condition: :not_guarded} do
8686
raise 'This code is executed but expected to fail'
8787
end
8888

89-
it 'guards if both only and except match', except: { condition: :guarded }, only: { condition: :guarded } do
89+
it 'guards if both only and except match', except: {condition: :guarded}, only: {condition: :guarded} do
9090
raise 'This code is executed but expected to fail'
9191
end
9292

93-
it 'guards if except matches and only does not', except: { condition: :guarded }, only: { condition: :not_guarded } do
93+
it 'guards if except matches and only does not', except: {condition: :guarded},
94+
only: {condition: :not_guarded} do
9495
raise 'This code is executed but expected to fail'
9596
end
9697

97-
it 'does not guard if only matches and except does not', except: { condition: :not_guarded },
98-
only: { condition: :guarded } do
98+
it 'does not guard if only matches and except does not', except: {condition: :not_guarded},
99+
only: {condition: :guarded} do
99100
# pass
100101
end
101102

102-
it 'gives correct reason', except: [{ condition: :guarded, reason: 'bug1' },
103-
{ condition: :not_guarded, reason: 'bug2' }] do
103+
it 'gives correct reason', except: [{condition: :guarded, reason: 'bug1'},
104+
{condition: :not_guarded, reason: 'bug2'}] do
104105
raise 'This code is executed but expected to fail'
105106
end
106107
end
107108

108109
context 'when array of hashes' do
109-
it 'guards if any Hash value is satisfied', only: [{ condition: :guarded }, { condition: :not_guarded }] do
110+
it 'guards if any Hash value is satisfied', only: [{condition: :guarded}, {condition: :not_guarded}] do
110111
raise 'This code is executed but expected to fail'
111112
end
112113
end

0 commit comments

Comments
 (0)