From ca4f9aa0014ed68771d46d4c2301049128e0bc4f Mon Sep 17 00:00:00 2001 From: Thomas Walpole Date: Mon, 28 Dec 2020 09:55:56 -0800 Subject: [PATCH] Update CI config for Ruby 3.0 release and update rubocop --- .rubocop.yml | 6 ++++-- .travis.yml | 8 ++++---- Rakefile | 6 ++++++ capybara.gemspec | 4 +++- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index b95a9fff..d46013b2 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,7 +1,9 @@ require: - rubocop-rspec - rubocop-performance - + - rubocop-minitest + - rubocop-rake + AllCops: NewCops: enable DisabledByDefault: false @@ -29,7 +31,7 @@ Metrics/BlockLength: - 'spec/**/*' - 'lib/capybara/spec/**/*' - 'capybara.gemspec' - ExcludedMethods: + IgnoredMethods: - Capybara.add_selector - Capybara::Selector::FilterSet.add diff --git a/.travis.yml b/.travis.yml index b5e197bd..b56b53f1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,8 +6,8 @@ services: - docker - xvfb rvm: - - 2.7 - - jruby-9.2.13.0 + - 3.0 + - jruby-9.2.14.0 gemfile: - Gemfile env: @@ -35,7 +35,7 @@ cache: matrix: include: - gemfile: gemfiles/Gemfile.gumbo - rvm: 2.6 + rvm: 2.7 script: bundle exec rake rack_smoke - gemfile: Gemfile rvm: 2.6 @@ -56,7 +56,7 @@ matrix: - gemfile: gemfiles/Gemfile.base-versions rvm: 2.5 - gemfile: Gemfile - rvm: 2.6 + rvm: 2.7 env: HEADLESS=true - gemfile: gemfiles/Gemfile.beta-versions rvm: 2.6 diff --git a/Rakefile b/Rakefile index 0acfdd19..c1e76dbc 100644 --- a/Rakefile +++ b/Rakefile @@ -18,6 +18,7 @@ RSpec::Core::RakeTask.new(:spec_firefox) do |t| end %w[chrome ie edge chrome_remote firefox_remote safari].each do |driver| + desc "Run tests using #{driver} driver" RSpec::Core::RakeTask.new(:"spec_#{driver}") do |t| t.rspec_opts = rspec_opts t.pattern = "./spec/{selenium_spec_#{driver}.rb}" @@ -35,8 +36,10 @@ RSpec::Core::RakeTask.new(:spec_rack) do |t| t.pattern = './spec{,/*/**}/*{_spec.rb}' end +desc 'Run specs with Firefox' task spec: [:spec_firefox] +desc 'Run basic smoke tests (rack test and rubocop)' task rack_smoke: %i[rubocop spec_rack] YARD::Rake::YardocTask.new do |t| @@ -47,6 +50,7 @@ Cucumber::Rake::Task.new(:cucumber) do |task| task.cucumber_opts = ['--format=progress', 'features'] end +desc 'Task for running CI' task :travis do if ENV['CAPYBARA_REMOTE'] && ENV['CAPYBARA_FF'] Rake::Task[:spec_firefox_remote].invoke @@ -64,6 +68,7 @@ task :travis do Rake::Task[:cucumber].invoke end +desc 'Build updated JS replacements for Selenium atoms' task :build_js do require 'uglifier' Dir.glob('./lib/capybara/selenium/atoms/src/*.js').each do |fn| @@ -78,6 +83,7 @@ task :build_js do end end +desc 'Release new version' task :release do version = Capybara::VERSION puts "Releasing #{version}, y/n?" diff --git a/capybara.gemspec b/capybara.gemspec index 2d6cf1d5..cb486894 100644 --- a/capybara.gemspec +++ b/capybara.gemspec @@ -47,8 +47,10 @@ Gem::Specification.new do |s| s.add_development_dependency('rspec', ['>= 3.5.0']) s.add_development_dependency('rspec-instafail') s.add_development_dependency('rubocop', ['~>1.1']) + s.add_development_dependency('rubocop-minitest') s.add_development_dependency('rubocop-performance') - s.add_development_dependency('rubocop-rspec', ['~>2.0.0.pre']) + s.add_development_dependency('rubocop-rake') + s.add_development_dependency('rubocop-rspec', ['~>2.0']) s.add_development_dependency('sauce_whisk') s.add_development_dependency('selenium_statistics') s.add_development_dependency('selenium-webdriver', ['~>3.5'])