Skip to content

Commit 62e867b

Browse files
committed
[rb] fix rubocop violations
1 parent b2b9211 commit 62e867b

File tree

4 files changed

+20
-13
lines changed

4 files changed

+20
-13
lines changed

rb/.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,6 @@ RSpec/BeforeAfterAll:
146146
RSpec/InstanceVariable:
147147
Exclude:
148148
- 'spec/unit/selenium/webdriver/socket_poller_spec.rb'
149+
150+
RSpec/DescribedClass:
151+
Enabled: false

rb/spec/unit/selenium/webdriver/common/driver_extensions/has_network_connection_spec.rb

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,16 @@ module Selenium
2323
module WebDriver
2424
module DriverExtensions
2525
describe HasNetworkConnection do
26-
class FakeDriver
27-
include HasNetworkConnection
28-
attr_reader :bridge
29-
def initialize(bridge)
30-
@bridge = bridge
26+
let(:fake_driver) do
27+
Class.new(WebDriver::Driver) do
28+
include HasNetworkConnection
29+
attr_reader :bridge
30+
def initialize(bridge)
31+
@bridge = bridge
32+
end
3133
end
3234
end
33-
34-
let(:driver) { FakeDriver.new(instance_double(Remote::Bridge)) }
35+
let(:driver) { fake_driver.new(instance_double(Remote::Bridge)) }
3536

3637
describe '#network_connection' do
3738
it 'returns the correct connection type' do

rb/spec/unit/selenium/webdriver/common/interactions/pointer_input_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ module Interactions
108108
allow(pointer).to receive(:no_actions?).and_return(false)
109109
expect(pointer.encode).to be_a(Hash)
110110
end
111+
111112
it 'should contain a type key with the value of the type attribute' do
112113
allow(pointer).to receive(:no_actions?).and_return(false)
113114
expect(pointer.encode).to include(type: pointer.type)

rb/spec/unit/selenium/webdriver/search_context_spec.rb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,21 @@
2222
module Selenium
2323
module WebDriver
2424
describe SearchContext do
25-
class TestSearchContext
26-
attr_reader :bridge, :ref
25+
let(:test_search_context) do
26+
Class.new do
27+
attr_reader :bridge, :ref
2728

28-
include Selenium::WebDriver::SearchContext
29+
include Selenium::WebDriver::SearchContext
2930

30-
def initialize(bridge)
31-
@bridge = bridge
31+
def initialize(bridge)
32+
@bridge = bridge
33+
end
3234
end
3335
end
3436

3537
let(:element) { instance_double(Element) }
3638
let(:bridge) { instance_double('Bridge').as_null_object }
37-
let(:search_context) { TestSearchContext.new(bridge) }
39+
let(:search_context) { test_search_context.new(bridge) }
3840

3941
context 'finding a single element' do
4042
it 'accepts a hash' do # rubocop:disable RSpec/RepeatedExample

0 commit comments

Comments
 (0)