Skip to content

Commit

Permalink
require 2.6.0 and update rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Oct 14, 2021
1 parent f501c19 commit c209cf8
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.4
ruby-version: 2.6
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run rubocop
run: bundle exec rake rubocop
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AllCops:
NewCops: enable
TargetRubyVersion: 2.4.10
TargetRubyVersion: 2.6.8

require:
- rubocop-rspec
Expand Down
12 changes: 5 additions & 7 deletions spec/webdrivers/geckodriver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,12 @@
end

it 'uses provided value' do
begin
install_dir = File.expand_path(File.join(ENV['HOME'], '.webdrivers2'))
Webdrivers.install_dir = install_dir
install_dir = File.expand_path(File.join(ENV['HOME'], '.webdrivers2'))
Webdrivers.install_dir = install_dir

expect(Webdrivers::System.install_dir).to eq install_dir
ensure
Webdrivers.install_dir = nil
end
expect(Webdrivers::System.install_dir).to eq install_dir
ensure
Webdrivers.install_dir = nil
end
end

Expand Down
12 changes: 5 additions & 7 deletions spec/webdrivers/i_edriver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,12 @@
end

it 'uses provided value' do
begin
install_dir = File.expand_path(File.join(ENV['HOME'], '.webdrivers2'))
Webdrivers.install_dir = install_dir
install_dir = File.expand_path(File.join(ENV['HOME'], '.webdrivers2'))
Webdrivers.install_dir = install_dir

expect(Webdrivers::System.install_dir).to eq install_dir
ensure
Webdrivers.install_dir = nil
end
expect(Webdrivers::System.install_dir).to eq install_dir
ensure
Webdrivers.install_dir = nil
end
end

Expand Down
36 changes: 15 additions & 21 deletions spec/webdrivers/webdrivers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,37 +49,31 @@
end

it 'uses provided value' do
begin
install_dir = File.expand_path(File.join(ENV['HOME'], '.webdrivers2'))
described_class.install_dir = install_dir
install_dir = File.expand_path(File.join(ENV['HOME'], '.webdrivers2'))
described_class.install_dir = install_dir

expect(described_class.install_dir).to eq install_dir
ensure
described_class.install_dir = nil
end
expect(described_class.install_dir).to eq install_dir
ensure
described_class.install_dir = nil
end

context 'when ENV variable WD_INSTALL_DIR is set and Webdrivers.install_dir is not' do
it 'uses path from the ENV variable' do
begin
described_class.install_dir = nil
allow(ENV).to receive(:[]).with('WD_INSTALL_DIR').and_return('custom_dir')
expect(described_class.install_dir).to be('custom_dir')
ensure
described_class.install_dir = nil
end
described_class.install_dir = nil
allow(ENV).to receive(:[]).with('WD_INSTALL_DIR').and_return('custom_dir')
expect(described_class.install_dir).to be('custom_dir')
ensure
described_class.install_dir = nil
end
end

context 'when both ENV variable WD_INSTALL_DIR and Webdrivers.install_dir are set' do
it 'uses path from Webdrivers.install_dir' do
begin
described_class.install_dir = 'my_install_dir_path'
allow(ENV).to receive(:[]).with('WD_INSTALL_DIR').and_return('my_env_path')
expect(described_class.install_dir).to be('my_install_dir_path')
ensure
described_class.install_dir = nil
end
described_class.install_dir = 'my_install_dir_path'
allow(ENV).to receive(:[]).with('WD_INSTALL_DIR').and_return('my_env_path')
expect(described_class.install_dir).to be('my_install_dir_path')
ensure
described_class.install_dir = nil
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion webdrivers.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require 'webdrivers/version'
Gem::Specification.new do |s|
s.name = 'webdrivers'
s.version = Webdrivers::VERSION
s.required_ruby_version = '>= 2.4.0'
s.required_ruby_version = '>= 2.6.0'
s.authors = ['Titus Fortner', 'Lakshya Kapoor', 'Thomas Walpole']
s.email = %w[titusfortner@gmail.com kapoorlakshya@gmail.com]
s.homepage = 'https://github.com/titusfortner/webdrivers'
Expand Down

0 comments on commit c209cf8

Please sign in to comment.