code style updates
This commit is contained in:
parent
8350c78823
commit
2528d335d4
|
@ -1,5 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
# rubocop:disable RSpec/Capybara/SpecificMatcher
|
||||||
|
|
||||||
Capybara::SpecHelper.spec '#has_css?' do
|
Capybara::SpecHelper.spec '#has_css?' do
|
||||||
before do
|
before do
|
||||||
@session.visit('/with_html')
|
@session.visit('/with_html')
|
||||||
|
@ -373,3 +375,5 @@ Capybara::SpecHelper.spec '#has_no_css?' do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# rubocop:enable RSpec/Capybara/SpecificMatcher
|
||||||
|
|
|
@ -3,31 +3,32 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
RSpec.describe Capybara::Server::Middleware::Counter do
|
RSpec.describe Capybara::Server::Middleware::Counter do
|
||||||
let(:counter) { Capybara::Server::Middleware::Counter.new }
|
let(:counter) { described_class.new }
|
||||||
let(:uri) { '/example' }
|
let(:uri) { '/example' }
|
||||||
|
|
||||||
context '#increment' do
|
describe '#increment' do
|
||||||
it 'successfully' do
|
it 'successfully' do
|
||||||
counter.increment(uri)
|
counter.increment(uri)
|
||||||
expect(counter.positive?).to be true
|
expect(counter).to be_positive
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'decrement' do
|
describe '#decrement' do
|
||||||
before do
|
before do
|
||||||
counter.increment(uri)
|
counter.increment(uri)
|
||||||
expect(counter.positive?).to be true
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'successfully' do
|
context 'successfully' do
|
||||||
it 'with same uri' do
|
it 'with same uri' do
|
||||||
|
expect(counter).to be_positive
|
||||||
counter.decrement(uri)
|
counter.decrement(uri)
|
||||||
expect(counter.positive?).to be false
|
expect(counter).not_to be_positive
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'with changed uri' do
|
it 'with changed uri' do
|
||||||
|
expect(counter).to be_positive
|
||||||
counter.decrement('/')
|
counter.decrement('/')
|
||||||
expect(counter.positive?).to be false
|
expect(counter).not_to be_positive
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -21,7 +21,7 @@ def ensure_selenium_running!
|
||||||
rescue StandardError
|
rescue StandardError
|
||||||
if timer.expired?
|
if timer.expired?
|
||||||
raise 'Selenium is not running. ' \
|
raise 'Selenium is not running. ' \
|
||||||
"You can run a selenium server easily with: \n" \
|
"You can run a selenium server easily with: \n. " \
|
||||||
'$ docker-compose up -d selenium_firefox'
|
'$ docker-compose up -d selenium_firefox'
|
||||||
else
|
else
|
||||||
puts 'Waiting for Selenium docker instance...'
|
puts 'Waiting for Selenium docker instance...'
|
||||||
|
|
Loading…
Reference in New Issue