From c569a2c7979c9c60c54d11764ae5a7ae4ed73486 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aslak=20Helles=C3=B8y?= Date: Wed, 11 Oct 2017 10:17:28 +0100 Subject: [PATCH 01/29] Disable Travis build in favour of CircleCI (faster) --- .travis.yml | 70 ----------------------------------------------------- README.md | 1 - 2 files changed, 71 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c53c3bbcfa..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,70 +0,0 @@ -sudo: false - -# Keep in sync with cucumber.gemspec's required_ruby_version -matrix: - include: - - rvm: ruby-head - os: linux - - rvm: ruby-head - os: osx - - rvm: 2.4.1 - os: linux - # TravisCI OSX doesn't work with Ruby 2.4.1 yet (https://github.com/travis-ci/travis-ci/issues/7848) - - rvm: 2.4.0 - os: osx - - rvm: 2.3.4 - os: linux - - rvm: 2.3.4 - os: osx - - rvm: 2.2 - os: linux - - rvm: 2.2 - os: osx - - rvm: 2.1 - os: linux - - rvm: 2.1 - os: osx - - rvm: jruby-9.1.13.0 - os: linux - env: - # Travis by default also have "-Dcext.enabled=false" set in - # JRUBY_OPTS, but JRuby 9 does not support C extensions at all - # so it issues warning that will mess up the sterr checks. - - JRUBY_OPTS="--server -Xcompile.invokedynamic=false" - # Somehow a "ASCII-8BIT to UTF-8 conversion error" appears for - # JRuby 9 - - LC_ALL=en_US.UTF-8 - - LANG=en_US.UTF-8 - - LANGUAGE=en_US.UTF-8 - - rvm: jruby-9.1.13.0 - os: osx - env: - # Travis by default also have "-Dcext.enabled=false" set in - # JRUBY_OPTS, but JRuby 9 does not support C extensions at all - # so it issues warning that will mess up the sterr checks. - - JRUBY_OPTS="--server -Xcompile.invokedynamic=false" - # Somehow a "ASCII-8BIT to UTF-8 conversion error" appears for - # JRuby 9 - - LC_ALL=en_US.UTF-8 - - LANG=en_US.UTF-8 - - LANGUAGE=en_US.UTF-8 - allow_failures: - - rvm: ruby-head - fast_finish: true - -# whitelist -branches: - only: - - master - - v1.3.x-bugfix - - expanded_ci - -before_install: - - gem update --system - - gem update bundler - -notifications: - webhooks: - urls: # gitter - - https://webhooks.gitter.im/e/dc010332f9d40fcc21c4 - slack: cucumberbdd:oQFVhzsx4R94KWmjlejAJYnM diff --git a/README.md b/README.md index 555a1b19ef..0433bb4463 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ [![OpenCollective](https://opencollective.com/cucumber/sponsors/badge.svg)](https://opencollective.com/cucumber) [![CircleCI](https://circleci.com/gh/cucumber/cucumber-ruby.svg?style=svg)](https://circleci.com/gh/cucumber/cucumber-ruby) -[![Build Status](https://travis-ci.org/cucumber/cucumber-ruby.svg?branch=master)](https://travis-ci.org/cucumber/cucumber-ruby) [![Windows Build Status](https://ci.appveyor.com/api/projects/status/ncqhcevrv93hhu5j?svg=true)](https://ci.appveyor.com/project/cucumberbdd/cucumber-ruby) [![Code Climate](https://codeclimate.com/github/cucumber/cucumber-ruby.svg)](https://codeclimate.com/github/cucumber/cucumber-ruby) From 99cf97c52e6e139b14a5270ccf007891bd03444c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aslak=20Helles=C3=B8y?= Date: Wed, 11 Oct 2017 10:33:31 +0100 Subject: [PATCH 02/29] Remove Travis/Coveralls/Ruby 2.1 --- .circleci/config.yml | 1 + CHANGELOG.md | 14 +++++++++----- Rakefile | 10 ---------- cucumber.gemspec | 3 +-- 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5abeea9603..f035df1450 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -105,6 +105,7 @@ workflows: version: 2 build: jobs: + # Keep lowest ruby-* version in sync with .cucumber.gemspec - "ruby-2.4.1" - "ruby-2.3.5" - "ruby-2.2.8" diff --git a/CHANGELOG.md b/CHANGELOG.md index ee20611bc3..20521250d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,23 +12,27 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo ## [In Git](https://github.com/cucumber/cucumber-ruby/compare/v3.0.1...master) (Not released) +### Added + +* N/A + ### Changed * N/A -### Added +### Deprecated * N/A +### Removed + +* Cucumber is no longer tested on Ruby 2.1 and below. + ### Fixed * Fix the printing of newlines in the rerun formatter - a problem introduced in [#1162](https://github.com/cucumber/cucumber-ruby/issues/1162) ([#1207](https://github.com/cucumber/cucumber-ruby/issues/1207) [@brasmusson](https://github.com/brasmusson)) * Handle the `--retry` option in profiles ([#1050](https://github.com/cucumber/cucumber-ruby/issues/1050) [@brasmusson](https://github.com/brasmusson)) -### Improved - -* N/A - ## [3.0.1](https://github.com/cucumber/cucumber-ruby/compare/v3.0.0...3.0.1) (2017-09-29) ### Fixed diff --git a/Rakefile b/Rakefile index 15257970ec..e22b6f6d9f 100644 --- a/Rakefile +++ b/Rakefile @@ -16,16 +16,6 @@ end default_tasks = [:spec, :rubocop, :cucumber] -if ENV['TRAVIS'] - ENV['SIMPLECOV'] = 'ci' - ENV['JRUBY_OPTS'] = [ENV['JRUBY_OPTS'], '--debug'].compact.join(' ') - - require 'coveralls/rake/task' - Coveralls::RakeTask.new - - default_tasks << 'coveralls:push' -end - task :default => default_tasks require 'rake/clean' diff --git a/cucumber.gemspec b/cucumber.gemspec index eb8e8cc96e..a388baa724 100644 --- a/cucumber.gemspec +++ b/cucumber.gemspec @@ -9,7 +9,7 @@ Gem::Specification.new do |s| s.license = 'MIT' s.homepage = 'https://cucumber.io/' s.platform = Gem::Platform::RUBY - s.required_ruby_version = '>= 2.1' # Keep in sync with .travis.yml + s.required_ruby_version = '>= 2.2' # Keep in sync with .circleci/config.yml s.add_dependency 'cucumber-core', '~> 3.0.0' s.add_dependency 'builder', '>= 2.1.2' s.add_dependency 'diff-lcs', '~> 1.3' @@ -26,7 +26,6 @@ Gem::Specification.new do |s| s.add_development_dependency 'rake', '>= 0.9.2' s.add_development_dependency 'rspec', '>= 3.6' s.add_development_dependency 'simplecov', '>= 0.6.2' - s.add_development_dependency 'coveralls', '~> 0.7' s.add_development_dependency 'syntax', '>= 1.0.0' s.add_development_dependency 'pry' s.add_development_dependency 'rubocop', '~> 0.40.0' From 250ace40affa7eb3a436281051f04040c8ad1fa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aslak=20Helles=C3=B8y?= Date: Wed, 11 Oct 2017 10:37:29 +0100 Subject: [PATCH 03/29] Remove coveralls config --- .coveralls.yml | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .coveralls.yml diff --git a/.coveralls.yml b/.coveralls.yml deleted file mode 100644 index 91600595a1..0000000000 --- a/.coveralls.yml +++ /dev/null @@ -1 +0,0 @@ -service_name: travis-ci From f2f14fa3cc24bdd7223e0f044648450f5b49cc69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aslak=20Helles=C3=B8y?= Date: Wed, 11 Oct 2017 10:39:10 +0100 Subject: [PATCH 04/29] Downgrade bundler requirement to a version that Appveyor has --- Gemfile.lock | 13 +------------ cucumber.gemspec | 2 +- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3a97506671..999b3cc940 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -35,12 +35,6 @@ GEM childprocess (0.8.0) ffi (~> 1.0, >= 1.0.11) coderay (1.1.2) - coveralls (0.8.21) - json (>= 1.8, < 3) - simplecov (~> 0.14.1) - term-ansicolor (~> 1.3) - thor (~> 0.19.4) - tins (~> 1.6) cucumber-core (3.0.0) backports (>= 3.8.0) cucumber-tag_expressions (>= 1.0.1) @@ -114,11 +108,7 @@ GEM rack-protection (~> 1.4) tilt (>= 1.3, < 3) syntax (1.2.2) - term-ansicolor (1.6.0) - tins (~> 1.0) - thor (0.19.4) tilt (2.0.8) - tins (1.15.0) unicode-display_width (1.3.0) xpath (2.1.0) nokogiri (~> 1.3) @@ -130,9 +120,8 @@ PLATFORMS DEPENDENCIES aruba (~> 0.6.1) bcat (~> 0.6.2) - bundler (~> 1.15.4) + bundler (~> 1.15.1) capybara (>= 2.1) - coveralls (~> 0.7) cucumber! json (~> 1.8.6) kramdown (~> 0.14) diff --git a/cucumber.gemspec b/cucumber.gemspec index a388baa724..9449d7e3ee 100644 --- a/cucumber.gemspec +++ b/cucumber.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |s| s.add_dependency 'cucumber-wire', '~> 0.0.1' s.add_dependency 'cucumber-expressions', '~> 4.0.3' - s.add_development_dependency 'bundler', '~> 1.15.4' + s.add_development_dependency 'bundler', '~> 1.15.1' s.add_development_dependency 'aruba', '~> 0.6.1' s.add_development_dependency 'json', '~> 1.8.6' s.add_development_dependency 'nokogiri', '~> 1.8.1' From de4e2356e38353088af4ee82404c3ef1d3411eb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aslak=20Helles=C3=B8y?= Date: Wed, 11 Oct 2017 10:45:05 +0100 Subject: [PATCH 05/29] Remove Rubocop from default Rake task (too slow) --- .circleci/config.yml | 28 ++++++++-------------------- Rakefile | 2 +- appveyor.yml | 1 - 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f035df1450..3e76a3d2ac 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,11 +23,8 @@ jobs: - ./vendor/bundle key: bundle-{{ checksum "Gemfile.lock" }} - run: - name: Run RSpec - command: bundle exec rake spec - - run: - name: Run Cucumber - command: bundle exec rake cucumber + name: Run Rake + command: bundle exec rake "ruby-2.3.5": docker: @@ -47,11 +44,8 @@ jobs: - ./vendor/bundle key: bundle-{{ checksum "Gemfile.lock" }} - run: - name: Run RSpec - command: bundle exec rake spec - - run: - name: Run Cucumber - command: bundle exec rake cucumber + name: Run Rake + command: bundle exec rake "ruby-2.2.8": docker: @@ -71,11 +65,8 @@ jobs: - ./vendor/bundle key: bundle-{{ checksum "Gemfile.lock" }} - run: - name: Run RSpec - command: bundle exec rake spec - - run: - name: Run Cucumber - command: bundle exec rake cucumber + name: Run Rake + command: bundle exec rake "jruby-9.1.13.0": docker: @@ -95,11 +86,8 @@ jobs: - ./vendor/bundle key: bundle-{{ checksum "Gemfile.lock" }} - run: - name: Run RSpec - command: bundle exec rake spec - - run: - name: Run Cucumber - command: bundle exec rake cucumber + name: Run Rake + command: bundle exec rake workflows: version: 2 diff --git a/Rakefile b/Rakefile index e22b6f6d9f..f1a11a543a 100644 --- a/Rakefile +++ b/Rakefile @@ -14,7 +14,7 @@ Cucumber::Rake::Task.new do |t| t.profile = 'ruby' if Cucumber::RUBY end -default_tasks = [:spec, :rubocop, :cucumber] +default_tasks = [:spec, :cucumber] task :default => default_tasks diff --git a/appveyor.yml b/appveyor.yml index 0424f16984..9aa0ed76a2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -24,4 +24,3 @@ notifications: - provider: Slack incoming_webhook: secure: Zj2V5eXlqH4jMNvdzMBmdLA+lr658qwlJO+o7yfvUc1TMRSLNQaId9rpVWX+FsEH6DsQxYr46BRWU0bymATBe7rf7KSkomCgsAdupvKYciI= - From a1a4c5fc97d18e394ab1a4009fdb6e37e3fcb83a Mon Sep 17 00:00:00 2001 From: Jayson Smith Date: Wed, 11 Oct 2017 12:51:27 -0700 Subject: [PATCH 06/29] Fix sort issue on Win7 env (#1210) --- spec/cucumber/cli/configuration_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/cucumber/cli/configuration_spec.rb b/spec/cucumber/cli/configuration_spec.rb index eba5daa99d..7b644c0efe 100644 --- a/spec/cucumber/cli/configuration_spec.rb +++ b/spec/cucumber/cli/configuration_spec.rb @@ -290,7 +290,7 @@ def reset_config it 'associates --out to previous --format' do config.parse!(%w{--format progress --out file1 --format profile --out file2}) - expect(config.formats).to eq [['progress', {}, 'file1'], ['profile', {}, 'file2']] + expect(config.formats).to match_array([['progress', {}, 'file1'], ['profile', {}, 'file2']]) end it 'accepts same --format options with same --out streams and keep only one' do @@ -302,7 +302,7 @@ def reset_config it 'accepts same --format options with different --out streams' do config.parse!(%w{--format html --out file1 --format html --out file2}) - expect(config.formats).to eq [['html', {}, 'file1'], ['html', {}, 'file2']] + expect(config.formats).to match_array([['html', {}, 'file1'], ['html', {}, 'file2']]) end it 'accepts --color option' do From a0a8ffcb56736fb9bdb89d94339cbb7178afed4f Mon Sep 17 00:00:00 2001 From: Jayson Smith Date: Sat, 14 Oct 2017 13:19:08 -0700 Subject: [PATCH 07/29] Fix TrailingBlankLines (#1211) * Fix TrailingBlankLines. - Primarily fixed with autofix (-aF) but number of changes made correlates with the reported violations * Updte todo --- .rubocop_todo.yml | 18 +----------------- examples/i18n/ar/Rakefile | 2 +- examples/i18n/ar/lib/calculator.rb | 2 +- .../step_definitions/calculator_steps.rb | 1 - examples/i18n/bg/lib/calculator.rb | 2 +- examples/i18n/ca/Rakefile | 2 +- examples/i18n/cs/Rakefile | 2 +- examples/i18n/da/Rakefile | 2 +- examples/i18n/de/Rakefile | 2 +- examples/i18n/de/lib/calculator.rb | 2 +- examples/i18n/el/Rakefile | 2 +- examples/i18n/el/lib/calculator.rb | 2 +- examples/i18n/en-lol/Rakefile | 2 +- examples/i18n/en-lol/lib/basket.rb | 2 +- examples/i18n/en-lol/lib/belly.rb | 2 +- examples/i18n/en/Rakefile | 2 +- examples/i18n/en/lib/calculator.rb | 2 +- examples/i18n/eo/Rakefile | 2 +- examples/i18n/eo/lib/calculator.rb | 2 +- examples/i18n/es/Rakefile | 2 +- examples/i18n/es/lib/calculador.rb | 2 +- examples/i18n/et/Rakefile | 2 +- examples/i18n/hi/Rakefile | 2 +- examples/i18n/ht/Rakefile | 2 +- examples/i18n/ht/lib/kalkilatris.rb | 2 +- .../step_definitions/calculator_steps.rb | 1 - examples/i18n/id/Rakefile | 2 +- examples/i18n/id/lib/calculator.rb | 2 +- examples/i18n/it/Rakefile | 2 +- examples/i18n/ja/lib/calculator.rb | 2 +- examples/i18n/ko/Rakefile | 2 +- examples/i18n/ko/lib/calculator.rb | 2 +- examples/i18n/lv/Rakefile | 2 +- examples/i18n/lv/lib/calculator.rb | 2 +- examples/i18n/no/Rakefile | 2 +- examples/i18n/no/lib/kalkulator.rb | 2 +- examples/i18n/pl/lib/calculator.rb | 2 +- examples/i18n/pt/Rakefile | 2 +- examples/i18n/ru/Rakefile | 2 +- .../step_definitions/calculator_steps.rb | 3 +++ examples/i18n/ru/lib/calculator.rb | 2 +- examples/i18n/sk/Rakefile | 2 +- examples/i18n/sk/lib/calculator.rb | 2 +- examples/i18n/sr-Cyrl/Rakefile | 2 +- examples/i18n/sr-Cyrl/lib/calculator.rb | 2 +- examples/i18n/sr-Latn/Rakefile | 2 +- examples/i18n/sr-Latn/lib/calculator.rb | 2 +- examples/i18n/sv/Rakefile | 2 +- examples/i18n/sv/lib/kalkulator.rb | 2 +- examples/i18n/tr/Rakefile | 2 +- examples/i18n/tr/lib/hesap_makinesi.rb | 2 +- examples/i18n/uk/Rakefile | 2 +- .../step_definitions/calculator_steps.rb | 3 +++ examples/i18n/uk/lib/calculator.rb | 2 +- examples/i18n/uz/Rakefile | 2 +- .../step_definitions/calculator_steps.rb | 3 +++ examples/i18n/uz/lib/calculator.rb | 2 +- examples/i18n/zh-CN/Rakefile | 2 +- examples/i18n/zh-TW/Rakefile | 2 +- examples/i18n/zh-TW/lib/calculator.rb | 2 +- examples/rspec_doubles/Rakefile | 2 +- examples/rspec_doubles/features/support/env.rb | 2 +- examples/sinatra/Rakefile | 2 +- examples/tcl/Rakefile | 2 +- examples/test_unit/Rakefile | 2 +- examples/watir/Rakefile | 2 +- lib/cucumber/events.rb | 1 - lib/cucumber/events/test_step_finished.rb | 2 -- lib/cucumber/events/test_step_started.rb | 2 -- lib/cucumber/filters/quit.rb | 1 - lib/cucumber/formatter/html_builder.rb | 2 +- .../formatter/ignore_missing_messages.rb | 1 - lib/cucumber/formatter/json_pretty.rb | 1 - lib/cucumber/formatter/summary.rb | 1 - lib/cucumber/glue/proto_world.rb | 2 ++ lib/cucumber/glue/world_factory.rb | 2 +- .../data_table/diff_matrices.rb | 1 - .../formatter/backtrace_filter_spec.rb | 2 -- spec/cucumber/formatter/pretty_spec.rb | 12 ++++++++++-- spec/cucumber/formatter/progress_spec.rb | 2 ++ spec/support/standard_step_actions.rb | 1 - 81 files changed, 86 insertions(+), 96 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index a00912c7d5..8b9569724d 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -960,22 +960,6 @@ Style/SymbolProc: - 'lib/cucumber/step_match_search.rb' - 'spec/cucumber/multiline_argument/data_table_spec.rb' -# Offense count: 69 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: final_newline, final_blank_line -Style/TrailingBlankLines: - Enabled: false - -# Offense count: 18 -# Cop supports --auto-correct. -# Reviewed: in pretty_spec.rb, progress_spec.rb offences look false, -# as the trailing spaces are in multiline string literals -Style/TrailingWhitespace: - Exclude: - - 'spec/cucumber/formatter/pretty_spec.rb' - - 'spec/cucumber/formatter/progress_spec.rb' - # Offense count: 1 # Cop supports --auto-correct. # Reviewed: when the offense is fixed there is one spec failing (./spec/cucumber/rb_support/rb_world_spec.rb:37) @@ -988,4 +972,4 @@ Style/UnneededInterpolation: # SupportedStyles: snake_case, camelCase # Reviewed: these offenses look false as the variables are in cyrillic Style/VariableName: - Enabled: false + Enabled: false \ No newline at end of file diff --git a/examples/i18n/ar/Rakefile b/examples/i18n/ar/Rakefile index 6a4175701e..80a1aec781 100644 --- a/examples/i18n/ar/Rakefile +++ b/examples/i18n/ar/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/i18n/ar/lib/calculator.rb b/examples/i18n/ar/lib/calculator.rb index 583aaca208..2696ebb996 100644 --- a/examples/i18n/ar/lib/calculator.rb +++ b/examples/i18n/ar/lib/calculator.rb @@ -8,4 +8,4 @@ def push(n) def جمع @args.inject(0){|n,sum| sum + n} end -end \ No newline at end of file +end diff --git a/examples/i18n/bg/features/step_definitions/calculator_steps.rb b/examples/i18n/bg/features/step_definitions/calculator_steps.rb index 684c19dd5c..a38e5b60e6 100644 --- a/examples/i18n/bg/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/bg/features/step_definitions/calculator_steps.rb @@ -21,4 +21,3 @@ Дадено %{въвел #{y}} Дадено %{натисна "+"} end - diff --git a/examples/i18n/bg/lib/calculator.rb b/examples/i18n/bg/lib/calculator.rb index a4ba9d5075..9c1b769f63 100644 --- a/examples/i18n/bg/lib/calculator.rb +++ b/examples/i18n/bg/lib/calculator.rb @@ -22,4 +22,4 @@ def / # Hm, @stack.pop(2) doesn't work @stack.push dividend / divisor end -end \ No newline at end of file +end diff --git a/examples/i18n/ca/Rakefile b/examples/i18n/ca/Rakefile index 6a4175701e..80a1aec781 100644 --- a/examples/i18n/ca/Rakefile +++ b/examples/i18n/ca/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/i18n/cs/Rakefile b/examples/i18n/cs/Rakefile index 6a4175701e..80a1aec781 100644 --- a/examples/i18n/cs/Rakefile +++ b/examples/i18n/cs/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/i18n/da/Rakefile b/examples/i18n/da/Rakefile index 6a4175701e..80a1aec781 100644 --- a/examples/i18n/da/Rakefile +++ b/examples/i18n/da/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/i18n/de/Rakefile b/examples/i18n/de/Rakefile index 6a4175701e..80a1aec781 100644 --- a/examples/i18n/de/Rakefile +++ b/examples/i18n/de/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/i18n/de/lib/calculator.rb b/examples/i18n/de/lib/calculator.rb index 4535355ea1..7a607963f1 100644 --- a/examples/i18n/de/lib/calculator.rb +++ b/examples/i18n/de/lib/calculator.rb @@ -11,4 +11,4 @@ def add def divide @args[0].to_f / @args[1].to_f end -end \ No newline at end of file +end diff --git a/examples/i18n/el/Rakefile b/examples/i18n/el/Rakefile index 6a4175701e..80a1aec781 100644 --- a/examples/i18n/el/Rakefile +++ b/examples/i18n/el/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/i18n/el/lib/calculator.rb b/examples/i18n/el/lib/calculator.rb index 4535355ea1..7a607963f1 100644 --- a/examples/i18n/el/lib/calculator.rb +++ b/examples/i18n/el/lib/calculator.rb @@ -11,4 +11,4 @@ def add def divide @args[0].to_f / @args[1].to_f end -end \ No newline at end of file +end diff --git a/examples/i18n/en-lol/Rakefile b/examples/i18n/en-lol/Rakefile index 668f91151a..d8b46f9562 100644 --- a/examples/i18n/en-lol/Rakefile +++ b/examples/i18n/en-lol/Rakefile @@ -1,4 +1,4 @@ $:.unshift(File.dirname(__FILE__) + '/../../../lib') require 'cucumber/rake/task' -Cucumber::Rake::Task.new \ No newline at end of file +Cucumber::Rake::Task.new diff --git a/examples/i18n/en-lol/lib/basket.rb b/examples/i18n/en-lol/lib/basket.rb index 2a4fdb9d5e..522fd41459 100644 --- a/examples/i18n/en-lol/lib/basket.rb +++ b/examples/i18n/en-lol/lib/basket.rb @@ -9,4 +9,4 @@ def take(cukes) @cukes -= cukes cukes end -end \ No newline at end of file +end diff --git a/examples/i18n/en-lol/lib/belly.rb b/examples/i18n/en-lol/lib/belly.rb index 1934ce7e5a..8529facca6 100644 --- a/examples/i18n/en-lol/lib/belly.rb +++ b/examples/i18n/en-lol/lib/belly.rb @@ -8,4 +8,4 @@ def initialize def eat(cukes) @cukes += cukes end -end \ No newline at end of file +end diff --git a/examples/i18n/en/Rakefile b/examples/i18n/en/Rakefile index 6a4175701e..80a1aec781 100644 --- a/examples/i18n/en/Rakefile +++ b/examples/i18n/en/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/i18n/en/lib/calculator.rb b/examples/i18n/en/lib/calculator.rb index 4535355ea1..7a607963f1 100644 --- a/examples/i18n/en/lib/calculator.rb +++ b/examples/i18n/en/lib/calculator.rb @@ -11,4 +11,4 @@ def add def divide @args[0].to_f / @args[1].to_f end -end \ No newline at end of file +end diff --git a/examples/i18n/eo/Rakefile b/examples/i18n/eo/Rakefile index 6a4175701e..80a1aec781 100644 --- a/examples/i18n/eo/Rakefile +++ b/examples/i18n/eo/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/i18n/eo/lib/calculator.rb b/examples/i18n/eo/lib/calculator.rb index 4535355ea1..7a607963f1 100644 --- a/examples/i18n/eo/lib/calculator.rb +++ b/examples/i18n/eo/lib/calculator.rb @@ -11,4 +11,4 @@ def add def divide @args[0].to_f / @args[1].to_f end -end \ No newline at end of file +end diff --git a/examples/i18n/es/Rakefile b/examples/i18n/es/Rakefile index 6a4175701e..80a1aec781 100644 --- a/examples/i18n/es/Rakefile +++ b/examples/i18n/es/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/i18n/es/lib/calculador.rb b/examples/i18n/es/lib/calculador.rb index 73ab2d20bb..55ee8e0639 100644 --- a/examples/i18n/es/lib/calculador.rb +++ b/examples/i18n/es/lib/calculador.rb @@ -11,4 +11,4 @@ def add def divide @args[0].to_f / @args[1].to_f end -end \ No newline at end of file +end diff --git a/examples/i18n/et/Rakefile b/examples/i18n/et/Rakefile index 6a4175701e..80a1aec781 100644 --- a/examples/i18n/et/Rakefile +++ b/examples/i18n/et/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/i18n/hi/Rakefile b/examples/i18n/hi/Rakefile index 6a4175701e..80a1aec781 100644 --- a/examples/i18n/hi/Rakefile +++ b/examples/i18n/hi/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/i18n/ht/Rakefile b/examples/i18n/ht/Rakefile index 6a4175701e..80a1aec781 100644 --- a/examples/i18n/ht/Rakefile +++ b/examples/i18n/ht/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/i18n/ht/lib/kalkilatris.rb b/examples/i18n/ht/lib/kalkilatris.rb index 430d86f284..379672de88 100644 --- a/examples/i18n/ht/lib/kalkilatris.rb +++ b/examples/i18n/ht/lib/kalkilatris.rb @@ -11,4 +11,4 @@ def ajoute def divize @args[0].to_f / @args[1].to_f end -end \ No newline at end of file +end diff --git a/examples/i18n/hu/features/step_definitions/calculator_steps.rb b/examples/i18n/hu/features/step_definitions/calculator_steps.rb index 4595323031..a2b96f9619 100644 --- a/examples/i18n/hu/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/hu/features/step_definitions/calculator_steps.rb @@ -27,4 +27,3 @@ Akkor(/^eredményül (.*)\-(?:e|a|ö|á|)t kell kapnom$/) do |result| @result.should == result.to_f end - diff --git a/examples/i18n/id/Rakefile b/examples/i18n/id/Rakefile index 6a4175701e..80a1aec781 100644 --- a/examples/i18n/id/Rakefile +++ b/examples/i18n/id/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/i18n/id/lib/calculator.rb b/examples/i18n/id/lib/calculator.rb index 4535355ea1..7a607963f1 100644 --- a/examples/i18n/id/lib/calculator.rb +++ b/examples/i18n/id/lib/calculator.rb @@ -11,4 +11,4 @@ def add def divide @args[0].to_f / @args[1].to_f end -end \ No newline at end of file +end diff --git a/examples/i18n/it/Rakefile b/examples/i18n/it/Rakefile index 6a4175701e..80a1aec781 100644 --- a/examples/i18n/it/Rakefile +++ b/examples/i18n/it/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/i18n/ja/lib/calculator.rb b/examples/i18n/ja/lib/calculator.rb index 4535355ea1..7a607963f1 100644 --- a/examples/i18n/ja/lib/calculator.rb +++ b/examples/i18n/ja/lib/calculator.rb @@ -11,4 +11,4 @@ def add def divide @args[0].to_f / @args[1].to_f end -end \ No newline at end of file +end diff --git a/examples/i18n/ko/Rakefile b/examples/i18n/ko/Rakefile index 6a4175701e..80a1aec781 100644 --- a/examples/i18n/ko/Rakefile +++ b/examples/i18n/ko/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/i18n/ko/lib/calculator.rb b/examples/i18n/ko/lib/calculator.rb index 4535355ea1..7a607963f1 100644 --- a/examples/i18n/ko/lib/calculator.rb +++ b/examples/i18n/ko/lib/calculator.rb @@ -11,4 +11,4 @@ def add def divide @args[0].to_f / @args[1].to_f end -end \ No newline at end of file +end diff --git a/examples/i18n/lv/Rakefile b/examples/i18n/lv/Rakefile index 6a4175701e..80a1aec781 100644 --- a/examples/i18n/lv/Rakefile +++ b/examples/i18n/lv/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/i18n/lv/lib/calculator.rb b/examples/i18n/lv/lib/calculator.rb index 4535355ea1..7a607963f1 100644 --- a/examples/i18n/lv/lib/calculator.rb +++ b/examples/i18n/lv/lib/calculator.rb @@ -11,4 +11,4 @@ def add def divide @args[0].to_f / @args[1].to_f end -end \ No newline at end of file +end diff --git a/examples/i18n/no/Rakefile b/examples/i18n/no/Rakefile index 6a4175701e..80a1aec781 100644 --- a/examples/i18n/no/Rakefile +++ b/examples/i18n/no/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/i18n/no/lib/kalkulator.rb b/examples/i18n/no/lib/kalkulator.rb index 954e2b7194..f93f0aa0e2 100644 --- a/examples/i18n/no/lib/kalkulator.rb +++ b/examples/i18n/no/lib/kalkulator.rb @@ -8,4 +8,4 @@ def add #@args[0] + @args[1] @args.inject(0){|n,sum| sum + n} end -end \ No newline at end of file +end diff --git a/examples/i18n/pl/lib/calculator.rb b/examples/i18n/pl/lib/calculator.rb index f204cfdf36..6071cc38e9 100644 --- a/examples/i18n/pl/lib/calculator.rb +++ b/examples/i18n/pl/lib/calculator.rb @@ -11,4 +11,4 @@ def dodaj def podziel @args[0].to_f / @args[1].to_f end -end \ No newline at end of file +end diff --git a/examples/i18n/pt/Rakefile b/examples/i18n/pt/Rakefile index 6a4175701e..80a1aec781 100644 --- a/examples/i18n/pt/Rakefile +++ b/examples/i18n/pt/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/i18n/ru/Rakefile b/examples/i18n/ru/Rakefile index 6a4175701e..80a1aec781 100644 --- a/examples/i18n/ru/Rakefile +++ b/examples/i18n/ru/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/i18n/ru/features/step_definitions/calculator_steps.rb b/examples/i18n/ru/features/step_definitions/calculator_steps.rb index 2eb87c39e2..45ed04f3aa 100644 --- a/examples/i18n/ru/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/ru/features/step_definitions/calculator_steps.rb @@ -1,4 +1,5 @@ # encoding: utf-8 +# rubocop:disable VariableName Допустим(/ввожу число (\d+)/) do |число| calc.push число.to_i @@ -17,3 +18,5 @@ Допустим %{затем ввожу число #{слагаемое2}} Допустим %{я нажимаю "+"} end + +# rubocop:enable VariableName diff --git a/examples/i18n/ru/lib/calculator.rb b/examples/i18n/ru/lib/calculator.rb index a4ba9d5075..9c1b769f63 100644 --- a/examples/i18n/ru/lib/calculator.rb +++ b/examples/i18n/ru/lib/calculator.rb @@ -22,4 +22,4 @@ def / # Hm, @stack.pop(2) doesn't work @stack.push dividend / divisor end -end \ No newline at end of file +end diff --git a/examples/i18n/sk/Rakefile b/examples/i18n/sk/Rakefile index 6a4175701e..80a1aec781 100644 --- a/examples/i18n/sk/Rakefile +++ b/examples/i18n/sk/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/i18n/sk/lib/calculator.rb b/examples/i18n/sk/lib/calculator.rb index 4535355ea1..7a607963f1 100644 --- a/examples/i18n/sk/lib/calculator.rb +++ b/examples/i18n/sk/lib/calculator.rb @@ -11,4 +11,4 @@ def add def divide @args[0].to_f / @args[1].to_f end -end \ No newline at end of file +end diff --git a/examples/i18n/sr-Cyrl/Rakefile b/examples/i18n/sr-Cyrl/Rakefile index 6a4175701e..80a1aec781 100644 --- a/examples/i18n/sr-Cyrl/Rakefile +++ b/examples/i18n/sr-Cyrl/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/i18n/sr-Cyrl/lib/calculator.rb b/examples/i18n/sr-Cyrl/lib/calculator.rb index ef187a5a09..c068fd0cd3 100644 --- a/examples/i18n/sr-Cyrl/lib/calculator.rb +++ b/examples/i18n/sr-Cyrl/lib/calculator.rb @@ -9,4 +9,4 @@ def add @args.inject(0){|n,sum| sum + n} end -end \ No newline at end of file +end diff --git a/examples/i18n/sr-Latn/Rakefile b/examples/i18n/sr-Latn/Rakefile index 6a4175701e..80a1aec781 100644 --- a/examples/i18n/sr-Latn/Rakefile +++ b/examples/i18n/sr-Latn/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/i18n/sr-Latn/lib/calculator.rb b/examples/i18n/sr-Latn/lib/calculator.rb index ef187a5a09..c068fd0cd3 100644 --- a/examples/i18n/sr-Latn/lib/calculator.rb +++ b/examples/i18n/sr-Latn/lib/calculator.rb @@ -9,4 +9,4 @@ def add @args.inject(0){|n,sum| sum + n} end -end \ No newline at end of file +end diff --git a/examples/i18n/sv/Rakefile b/examples/i18n/sv/Rakefile index 6a4175701e..80a1aec781 100644 --- a/examples/i18n/sv/Rakefile +++ b/examples/i18n/sv/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/i18n/sv/lib/kalkulator.rb b/examples/i18n/sv/lib/kalkulator.rb index 954e2b7194..f93f0aa0e2 100644 --- a/examples/i18n/sv/lib/kalkulator.rb +++ b/examples/i18n/sv/lib/kalkulator.rb @@ -8,4 +8,4 @@ def add #@args[0] + @args[1] @args.inject(0){|n,sum| sum + n} end -end \ No newline at end of file +end diff --git a/examples/i18n/tr/Rakefile b/examples/i18n/tr/Rakefile index 6a4175701e..80a1aec781 100644 --- a/examples/i18n/tr/Rakefile +++ b/examples/i18n/tr/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/i18n/tr/lib/hesap_makinesi.rb b/examples/i18n/tr/lib/hesap_makinesi.rb index 951535b44c..69e52db8ab 100644 --- a/examples/i18n/tr/lib/hesap_makinesi.rb +++ b/examples/i18n/tr/lib/hesap_makinesi.rb @@ -12,4 +12,4 @@ def topla def böl @args[0].to_f / @args[1].to_f end -end \ No newline at end of file +end diff --git a/examples/i18n/uk/Rakefile b/examples/i18n/uk/Rakefile index 6a4175701e..80a1aec781 100644 --- a/examples/i18n/uk/Rakefile +++ b/examples/i18n/uk/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/i18n/uk/features/step_definitions/calculator_steps.rb b/examples/i18n/uk/features/step_definitions/calculator_steps.rb index 95767e119c..d28cb1f6af 100644 --- a/examples/i18n/uk/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/uk/features/step_definitions/calculator_steps.rb @@ -1,4 +1,5 @@ # encoding: utf-8 +# rubocop:disable VariableName Припустимо(/ввожу число (\d+)/) do |число| calc.push число.to_i @@ -17,3 +18,5 @@ Припустимо %{потім ввожу число #{доданок2}} Припустимо %{я натискаю "+"} end + +# rubocop:enable VariableName diff --git a/examples/i18n/uk/lib/calculator.rb b/examples/i18n/uk/lib/calculator.rb index a4ba9d5075..9c1b769f63 100644 --- a/examples/i18n/uk/lib/calculator.rb +++ b/examples/i18n/uk/lib/calculator.rb @@ -22,4 +22,4 @@ def / # Hm, @stack.pop(2) doesn't work @stack.push dividend / divisor end -end \ No newline at end of file +end diff --git a/examples/i18n/uz/Rakefile b/examples/i18n/uz/Rakefile index 6a4175701e..80a1aec781 100644 --- a/examples/i18n/uz/Rakefile +++ b/examples/i18n/uz/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/i18n/uz/features/step_definitions/calculator_steps.rb b/examples/i18n/uz/features/step_definitions/calculator_steps.rb index 70541d8d41..ecf196217d 100644 --- a/examples/i18n/uz/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/uz/features/step_definitions/calculator_steps.rb @@ -1,4 +1,5 @@ # encoding: utf-8 +# rubocop:disable VariableName Агар(/(\d+) сонини киритсам/) do |сон| calc.push сон.to_i @@ -17,3 +18,5 @@ Агар %{ундан сунг #{кушилувчи2} сонини киритсам} Агар %{"+"ни боссам} end + +# rubocop:enable VariableName diff --git a/examples/i18n/uz/lib/calculator.rb b/examples/i18n/uz/lib/calculator.rb index a4ba9d5075..9c1b769f63 100644 --- a/examples/i18n/uz/lib/calculator.rb +++ b/examples/i18n/uz/lib/calculator.rb @@ -22,4 +22,4 @@ def / # Hm, @stack.pop(2) doesn't work @stack.push dividend / divisor end -end \ No newline at end of file +end diff --git a/examples/i18n/zh-CN/Rakefile b/examples/i18n/zh-CN/Rakefile index 668f91151a..d8b46f9562 100644 --- a/examples/i18n/zh-CN/Rakefile +++ b/examples/i18n/zh-CN/Rakefile @@ -1,4 +1,4 @@ $:.unshift(File.dirname(__FILE__) + '/../../../lib') require 'cucumber/rake/task' -Cucumber::Rake::Task.new \ No newline at end of file +Cucumber::Rake::Task.new diff --git a/examples/i18n/zh-TW/Rakefile b/examples/i18n/zh-TW/Rakefile index 668f91151a..d8b46f9562 100644 --- a/examples/i18n/zh-TW/Rakefile +++ b/examples/i18n/zh-TW/Rakefile @@ -1,4 +1,4 @@ $:.unshift(File.dirname(__FILE__) + '/../../../lib') require 'cucumber/rake/task' -Cucumber::Rake::Task.new \ No newline at end of file +Cucumber::Rake::Task.new diff --git a/examples/i18n/zh-TW/lib/calculator.rb b/examples/i18n/zh-TW/lib/calculator.rb index 4535355ea1..7a607963f1 100644 --- a/examples/i18n/zh-TW/lib/calculator.rb +++ b/examples/i18n/zh-TW/lib/calculator.rb @@ -11,4 +11,4 @@ def add def divide @args[0].to_f / @args[1].to_f end -end \ No newline at end of file +end diff --git a/examples/rspec_doubles/Rakefile b/examples/rspec_doubles/Rakefile index 61d1f1f7ae..c5054a28ca 100644 --- a/examples/rspec_doubles/Rakefile +++ b/examples/rspec_doubles/Rakefile @@ -1,4 +1,4 @@ $:.unshift(File.dirname(__FILE__) + '/../../lib') require 'cucumber/rake/task' -Cucumber::Rake::Task.new \ No newline at end of file +Cucumber::Rake::Task.new diff --git a/examples/rspec_doubles/features/support/env.rb b/examples/rspec_doubles/features/support/env.rb index 0d85317d89..da799f46b6 100644 --- a/examples/rspec_doubles/features/support/env.rb +++ b/examples/rspec_doubles/features/support/env.rb @@ -9,4 +9,4 @@ # c.mock_framework = :flexmock # end -require 'cucumber/rspec/doubles' \ No newline at end of file +require 'cucumber/rspec/doubles' diff --git a/examples/sinatra/Rakefile b/examples/sinatra/Rakefile index a5cf96ac4b..d5b3dc4833 100644 --- a/examples/sinatra/Rakefile +++ b/examples/sinatra/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/tcl/Rakefile b/examples/tcl/Rakefile index a5cf96ac4b..d5b3dc4833 100644 --- a/examples/tcl/Rakefile +++ b/examples/tcl/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/test_unit/Rakefile b/examples/test_unit/Rakefile index a5cf96ac4b..d5b3dc4833 100644 --- a/examples/test_unit/Rakefile +++ b/examples/test_unit/Rakefile @@ -3,4 +3,4 @@ require 'cucumber/rake/task' Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} -end \ No newline at end of file +end diff --git a/examples/watir/Rakefile b/examples/watir/Rakefile index 60fc61c25c..f1bcf6918c 100644 --- a/examples/watir/Rakefile +++ b/examples/watir/Rakefile @@ -9,4 +9,4 @@ Cucumber::Rake::Task.new(:cucumber_screenshot) do |t| t.cucumber_opts = %w{--format html --out report.html} end -task :default => :cucumber \ No newline at end of file +task :default => :cucumber diff --git a/lib/cucumber/events.rb b/lib/cucumber/events.rb index 2e566c48cd..6affdd0d0b 100644 --- a/lib/cucumber/events.rb +++ b/lib/cucumber/events.rb @@ -37,4 +37,3 @@ def self.registry end end end - diff --git a/lib/cucumber/events/test_step_finished.rb b/lib/cucumber/events/test_step_finished.rb index 744d9f5e1d..dabd517b03 100644 --- a/lib/cucumber/events/test_step_finished.rb +++ b/lib/cucumber/events/test_step_finished.rb @@ -16,5 +16,3 @@ class TestStepFinished < Core::Events::TestStepFinished end end - - diff --git a/lib/cucumber/events/test_step_started.rb b/lib/cucumber/events/test_step_started.rb index f260ecb329..7d92f8da10 100644 --- a/lib/cucumber/events/test_step_started.rb +++ b/lib/cucumber/events/test_step_started.rb @@ -13,5 +13,3 @@ class TestStepStarted < Core::Events::TestStepStarted end end - - diff --git a/lib/cucumber/filters/quit.rb b/lib/cucumber/filters/quit.rb index cad991a193..49d0ad5b18 100644 --- a/lib/cucumber/filters/quit.rb +++ b/lib/cucumber/filters/quit.rb @@ -26,4 +26,3 @@ def with_receiver(receiver) end end - diff --git a/lib/cucumber/formatter/html_builder.rb b/lib/cucumber/formatter/html_builder.rb index 0ca6a58ac6..bbee021dd6 100644 --- a/lib/cucumber/formatter/html_builder.rb +++ b/lib/cucumber/formatter/html_builder.rb @@ -117,4 +117,4 @@ def set_head_tags end end end -end \ No newline at end of file +end diff --git a/lib/cucumber/formatter/ignore_missing_messages.rb b/lib/cucumber/formatter/ignore_missing_messages.rb index 3a8e5753e0..06aafccbae 100644 --- a/lib/cucumber/formatter/ignore_missing_messages.rb +++ b/lib/cucumber/formatter/ignore_missing_messages.rb @@ -18,4 +18,3 @@ def respond_to_missing?(name, include_private = false) end end - diff --git a/lib/cucumber/formatter/json_pretty.rb b/lib/cucumber/formatter/json_pretty.rb index 8f1982558c..a8d19c46fd 100644 --- a/lib/cucumber/formatter/json_pretty.rb +++ b/lib/cucumber/formatter/json_pretty.rb @@ -8,4 +8,3 @@ class JsonPretty < Json end end end - diff --git a/lib/cucumber/formatter/summary.rb b/lib/cucumber/formatter/summary.rb index e150159036..39cb1cb951 100644 --- a/lib/cucumber/formatter/summary.rb +++ b/lib/cucumber/formatter/summary.rb @@ -55,4 +55,3 @@ def print_result(result) end end end - diff --git a/lib/cucumber/glue/proto_world.rb b/lib/cucumber/glue/proto_world.rb index e79ac95252..d468113185 100644 --- a/lib/cucumber/glue/proto_world.rb +++ b/lib/cucumber/glue/proto_world.rb @@ -148,6 +148,7 @@ def add_modules!(world_modules, namespaced_world_modules) runtime.invoke_dynamic_steps(steps_text, language, location) end + # rubocop:disable UnneededInterpolation define_method(:puts) do |*messages| # Even though they won't be output until later, converting the messages to # strings right away will protect them from modifications to their original @@ -156,6 +157,7 @@ def add_modules!(world_modules, namespaced_world_modules) runtime.puts(*messages) end + # rubocop:enable UnneededInterpolation define_method(:ask) do |question, timeout_seconds=60| runtime.ask(question, timeout_seconds) diff --git a/lib/cucumber/glue/world_factory.rb b/lib/cucumber/glue/world_factory.rb index 548668c45e..ba4ac92391 100644 --- a/lib/cucumber/glue/world_factory.rb +++ b/lib/cucumber/glue/world_factory.rb @@ -20,4 +20,4 @@ def raise_nil_world end end -end \ No newline at end of file +end diff --git a/lib/cucumber/multiline_argument/data_table/diff_matrices.rb b/lib/cucumber/multiline_argument/data_table/diff_matrices.rb index ea78b3d327..3dc3a6d0cf 100644 --- a/lib/cucumber/multiline_argument/data_table/diff_matrices.rb +++ b/lib/cucumber/multiline_argument/data_table/diff_matrices.rb @@ -155,4 +155,3 @@ def should_raise? end end end - diff --git a/spec/cucumber/formatter/backtrace_filter_spec.rb b/spec/cucumber/formatter/backtrace_filter_spec.rb index 6425bcd0a6..5b2075bf44 100644 --- a/spec/cucumber/formatter/backtrace_filter_spec.rb +++ b/spec/cucumber/formatter/backtrace_filter_spec.rb @@ -28,5 +28,3 @@ module Formatter end end end - - diff --git a/spec/cucumber/formatter/pretty_spec.rb b/spec/cucumber/formatter/pretty_spec.rb index a4af7f6e89..b6db77bbee 100644 --- a/spec/cucumber/formatter/pretty_spec.rb +++ b/spec/cucumber/formatter/pretty_spec.rb @@ -39,6 +39,7 @@ module Formatter end end + # rubocop:disable TrailingWhitespace describe 'with a background' do define_feature <<-FEATURE Feature: Banana party @@ -62,6 +63,7 @@ module Formatter expect(@out.string).to include 'Given there are bananas' end end + # rubocop:enable TrailingWhitespace describe 'with a scenario outline' do define_feature <<-FEATURE @@ -293,6 +295,7 @@ module Formatter Given('this step passes') {} end + # rubocop:disable TrailingWhitespace it 'displays hook output appropriately ' do expect( @out.string ).to include < Date: Thu, 28 Sep 2017 00:00:55 +0200 Subject: [PATCH 08/29] Travis: skip gem update --system; rvm does it now --- .rubocop.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.rubocop.yml b/.rubocop.yml index a108ae0b58..16c6dc9a76 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -11,3 +11,4 @@ AllCops: DisplayStyleGuide: true Exclude: - 'tmp/**/*' + - 'vendor/**/*' From 333742db00029af2e82776506a2e328e1a83869b Mon Sep 17 00:00:00 2001 From: Jayson Smith Date: Sat, 14 Oct 2017 16:45:22 -0700 Subject: [PATCH 09/29] Fix SymbolProc issues (#1212) * Fix SymbolPro issues - Deals with Ruby preferring the use of '&:downcase' with things like maps instead of simple blocks - Changed with autofix. '37 offenses detected, 37 offenses corrected' - No local test errors * Update todo --- .rubocop_todo.yml | 26 +++++----- lib/cucumber/cli/options.rb | 2 +- lib/cucumber/errors.rb | 2 +- lib/cucumber/formatter/json.rb | 2 +- lib/cucumber/multiline_argument.rb | 2 +- lib/cucumber/multiline_argument/data_table.rb | 16 +++--- lib/cucumber/step_definitions.rb | 2 +- lib/cucumber/step_match.rb | 2 +- lib/cucumber/step_match_search.rb | 2 +- .../multiline_argument/data_table_spec.rb | 52 ++++++++----------- 10 files changed, 48 insertions(+), 60 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 8b9569724d..17646c0b5d 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -944,21 +944,21 @@ Style/StructInheritance: - 'lib/cucumber/formatter/legacy_api/adapter.rb' - 'lib/cucumber/formatter/legacy_api/runtime_facade.rb' -# Offense count: 35 +# Offense count: 69 # Cop supports --auto-correct. -# Configuration parameters: IgnoredMethods. -# IgnoredMethods: respond_to, define_method -Style/SymbolProc: +# Configuration parameters: EnforcedStyle, SupportedStyles. +# SupportedStyles: final_newline, final_blank_line +Style/TrailingBlankLines: + Enabled: false + +# Offense count: 18 +# Cop supports --auto-correct. +# Reviewed: in pretty_spec.rb, progress_spec.rb offences look false, +# as the trailing spaces are in multiline string literals +Style/TrailingWhitespace: Exclude: - - 'lib/cucumber/cli/options.rb' - - 'lib/cucumber/errors.rb' - - 'lib/cucumber/formatter/json.rb' - - 'lib/cucumber/multiline_argument.rb' - - 'lib/cucumber/multiline_argument/data_table.rb' - - 'lib/cucumber/step_definitions.rb' - - 'lib/cucumber/step_match.rb' - - 'lib/cucumber/step_match_search.rb' - - 'spec/cucumber/multiline_argument/data_table_spec.rb' + - 'spec/cucumber/formatter/pretty_spec.rb' + - 'spec/cucumber/formatter/progress_spec.rb' # Offense count: 1 # Cop supports --auto-correct. diff --git a/lib/cucumber/cli/options.rb b/lib/cucumber/cli/options.rb index 51c9d1446e..8d54c5283b 100644 --- a/lib/cucumber/cli/options.rb +++ b/lib/cucumber/cli/options.rb @@ -27,7 +27,7 @@ class Options 'json_pretty' => ['Cucumber::Formatter::JsonPretty', 'Prints the feature as prettified JSON'], 'summary' => ['Cucumber::Formatter::Summary', 'Summary output of feature and scenarios'] } - max = BUILTIN_FORMATS.keys.map{|s| s.length}.max + max = BUILTIN_FORMATS.keys.map(&:length).max FORMAT_HELP_MSG = [ 'Use --format rerun --out rerun.txt to write out failing', 'features. You can rerun them with cucumber @rerun.txt.', diff --git a/lib/cucumber/errors.rb b/lib/cucumber/errors.rb index 03c3b2c059..26c58094e3 100644 --- a/lib/cucumber/errors.rb +++ b/lib/cucumber/errors.rb @@ -38,7 +38,7 @@ class Ambiguous < StandardError def initialize(step_name, step_definitions, used_guess) message = String.new message << "Ambiguous match of \"#{step_name}\":\n\n" - message << step_definitions.map{|sd| sd.backtrace_line}.join("\n") + message << step_definitions.map(&:backtrace_line).join("\n") message << "\n\n" message << "You can run again with --guess to make Cucumber be more smart about it\n" unless used_guess super(message) diff --git a/lib/cucumber/formatter/json.rb b/lib/cucumber/formatter/json.rb index 76fbdcb4f9..e6dfbd8384 100644 --- a/lib/cucumber/formatter/json.rb +++ b/lib/cucumber/formatter/json.rb @@ -82,7 +82,7 @@ def puts(message) def embed(src, mime_type, _label) if File.file?(src) - content = File.open(src, 'rb') { |f| f.read } + content = File.open(src, 'rb', &:read) data = encode64(content) else if mime_type =~ /;base64$/ diff --git a/lib/cucumber/multiline_argument.rb b/lib/cucumber/multiline_argument.rb index 38353fb5aa..72e4d8f0ea 100644 --- a/lib/cucumber/multiline_argument.rb +++ b/lib/cucumber/multiline_argument.rb @@ -18,7 +18,7 @@ def from(argument, location=nil, content_type=nil) builder.doc_string(Core::Ast::DocString.new(argument, content_type, location)) when Array location = location.on_line(argument.first.line..argument.last.line) - builder.data_table(argument.map{ |row| row.cells }, location) + builder.data_table(argument.map(&:cells), location) when DataTable, DocString, None argument when nil diff --git a/lib/cucumber/multiline_argument/data_table.rb b/lib/cucumber/multiline_argument/data_table.rb index dd920ef5bc..d02a4ab8ba 100644 --- a/lib/cucumber/multiline_argument/data_table.rb +++ b/lib/cucumber/multiline_argument/data_table.rb @@ -195,14 +195,12 @@ def rows_hash # def raw cell_matrix.map do |row| - row.map do |cell| - cell.value - end + row.map(&:value) end end def column_names #:nodoc: - @col_names ||= cell_matrix[0].map { |cell| cell.value } + @col_names ||= cell_matrix[0].map(&:value) end def rows @@ -443,9 +441,7 @@ def to_json(*args) def build_hashes convert_headers! convert_columns! - cells_rows[1..-1].map do |row| - row.to_hash - end + cells_rows[1..-1].map(&:to_hash) end def create_cell_matrix(ast_table) #:nodoc: @@ -475,14 +471,14 @@ def convert_headers! #:nodoc: header_cells = cell_matrix[0] if @header_conversion_proc - header_values = header_cells.map { |cell| cell.value } - @header_mappings.keys + header_values = header_cells.map(&:value) - @header_mappings.keys @header_mappings = @header_mappings.merge(Hash[*header_values.zip(header_values.map(&@header_conversion_proc)).flatten]) end @header_mappings.each_pair do |pre, post| mapped_cells = header_cells.select { |cell| pre === cell.value } raise "No headers matched #{pre.inspect}" if mapped_cells.empty? - raise "#{mapped_cells.length} headers matched #{pre.inspect}: #{mapped_cells.map { |c| c.value }.inspect}" if mapped_cells.length > 1 + raise "#{mapped_cells.length} headers matched #{pre.inspect}: #{mapped_cells.map(&:value).inspect}" if mapped_cells.length > 1 mapped_cells[0].value = post if @conversion_procs.key?(pre) @conversion_procs[post] = @conversion_procs.delete(pre) @@ -524,7 +520,7 @@ def accept(visitor) # For testing only def to_sexp #:nodoc: - [:row, line, *@cells.map{|cell| cell.to_sexp}] + [:row, line, *@cells.map(&:to_sexp)] end def to_hash #:nodoc: diff --git a/lib/cucumber/step_definitions.rb b/lib/cucumber/step_definitions.rb index 5d30f9060e..d0642fffce 100644 --- a/lib/cucumber/step_definitions.rb +++ b/lib/cucumber/step_definitions.rb @@ -8,7 +8,7 @@ def initialize(configuration = Configuration.default) end def to_json - @support_code.step_definitions.map{|stepdef| stepdef.to_hash}.to_json + @support_code.step_definitions.map(&:to_hash).to_json end end end diff --git a/lib/cucumber/step_match.rb b/lib/cucumber/step_match.rb index f2397dc861..d639a45862 100644 --- a/lib/cucumber/step_match.rb +++ b/lib/cucumber/step_match.rb @@ -13,7 +13,7 @@ def initialize(step_definition, step_name, step_arguments) end def args - @step_arguments.map{|g| g.value } + @step_arguments.map(&:value) end def activate(test_step) diff --git a/lib/cucumber/step_match_search.rb b/lib/cucumber/step_match_search.rb index 03f9551a55..05f7b6e51c 100644 --- a/lib/cucumber/step_match_search.rb +++ b/lib/cucumber/step_match_search.rb @@ -39,7 +39,7 @@ def best_matches(_step_name, step_matches) #:nodoc: top_groups = step_matches.select {|step_match| step_match.args.length == max_arg_length } if no_groups.any? - longest_regexp_length = no_groups.map {|step_match| step_match.text_length }.max + longest_regexp_length = no_groups.map(&:text_length).max no_groups.select {|step_match| step_match.text_length == longest_regexp_length } elsif top_groups.any? shortest_capture_length = top_groups.map {|step_match| step_match.args.inject(0) {|sum, c| sum + c.to_s.length } }.min diff --git a/spec/cucumber/multiline_argument/data_table_spec.rb b/spec/cucumber/multiline_argument/data_table_spec.rb index bd213c0c2b..a449d64356 100644 --- a/spec/cucumber/multiline_argument/data_table_spec.rb +++ b/spec/cucumber/multiline_argument/data_table_spec.rb @@ -14,11 +14,11 @@ module MultilineArgument end it 'should have rows' do - expect( @table.cells_rows[0].map{|cell| cell.value} ).to eq %w{one four seven} + expect( @table.cells_rows[0].map(&:value) ).to eq %w{one four seven} end it 'should have columns' do - expect( @table.columns[1].map{|cell| cell.value} ).to eq %w{four 55555} + expect( @table.columns[1].map(&:value) ).to eq %w{four 55555} end it 'should have same cell objects in rows and columns' do @@ -62,7 +62,7 @@ module MultilineArgument describe '#map_column!' do it 'should allow mapping columns' do - @table.map_column!('one') { |v| v.to_i } + @table.map_column!('one', &:to_i) expect( @table.hashes.first['one'] ).to eq 4444 end @@ -77,38 +77,38 @@ module MultilineArgument end it 'should allow mapping columns and take a symbol as the column name' do - @table.map_column!(:one) { |v| v.to_i } + @table.map_column!(:one, &:to_i) expect( @table.hashes.first['one'] ).to eq 4444 end it 'should allow mapping columns and modify the rows as well' do - @table.map_column!(:one) { |v| v.to_i } + @table.map_column!(:one, &:to_i) expect( @table.rows.first ).to include(4444) expect( @table.rows.first ).to_not include('4444') end it 'should pass silently if a mapped column does not exist in non-strict mode' do expect { - @table.map_column!('two', false) { |v| v.to_i } + @table.map_column!('two', false, &:to_i) @table.hashes }.not_to raise_error end it 'should fail if a mapped column does not exist in strict mode' do expect { - @table.map_column!('two', true) { |v| v.to_i } + @table.map_column!('two', true, &:to_i) @table.hashes }.to raise_error('The column named "two" does not exist') end it 'should return the table' do - expect( (@table.map_column!(:one) { |v| v.to_i }) ).to eq @table + expect( @table.map_column!(:one, &:to_i) ).to eq @table end end describe '#map_column' do it 'should allow mapping columns' do - new_table = @table.map_column('one') { |v| v.to_i } + new_table = @table.map_column('one', &:to_i) expect( new_table.hashes.first['one'] ).to eq 4444 end @@ -123,32 +123,32 @@ module MultilineArgument end it 'should allow mapping columns and take a symbol as the column name' do - new_table = @table.map_column(:one) { |v| v.to_i } + new_table = @table.map_column(:one, &:to_i) expect( new_table.hashes.first['one'] ).to eq 4444 end it 'should allow mapping columns and modify the rows as well' do - new_table = @table.map_column(:one) { |v| v.to_i } + new_table = @table.map_column(:one, &:to_i) expect( new_table.rows.first ).to include(4444) expect( new_table.rows.first ).to_not include('4444') end it 'should pass silently if a mapped column does not exist in non-strict mode' do expect { - new_table = @table.map_column('two', false) { |v| v.to_i } + new_table = @table.map_column('two', false, &:to_i) new_table.hashes }.not_to raise_error end it 'should fail if a mapped column does not exist in strict mode' do expect { - new_table = @table.map_column('two', true) { |v| v.to_i } + new_table = @table.map_column('two', true, &:to_i) new_table.hashes }.to raise_error('The column named "two" does not exist') end it 'should return a new table' do - expect( (@table.map_column(:one) { |v| v.to_i }) ).to_not eq @table + expect( @table.map_column(:one, &:to_i) ).to_not eq @table end end @@ -209,8 +209,8 @@ module MultilineArgument %w{one 1111}, %w{two 22222} ]) - t2 = table.map_headers({ 'two' => 'Two' }) { |header| header.upcase }. - map_column('two', false) { |val| val.to_i } + t2 = table.map_headers({ 'two' => 'Two' }, &:upcase). + map_column('two', false, &:to_i) expect( t2.rows_hash ).to eq( 'ONE' => '1111', 'Two' => 22222 ) end end @@ -234,22 +234,18 @@ module MultilineArgument end it 'copies column mappings' do - @table.map_column!('one') { |v| v.to_i } + @table.map_column!('one', &:to_i) @table.map_headers!('one' => 'three') expect( @table.hashes.first['three'] ).to eq 4444 end it 'takes a block and operates on all the headers with it' do - table.map_headers! do |header| - header.downcase - end + table.map_headers!(&:downcase) expect( table.hashes.first.keys ).to match %w[hello world] end it 'treats the mappings in the provided hash as overrides when used with a block' do - table.map_headers!('WORLD' => 'foo') do |header| - header.downcase - end + table.map_headers!('WORLD' => 'foo', &:downcase) expect( table.hashes.first.keys ).to match %w[hello foo] end @@ -274,23 +270,19 @@ module MultilineArgument end it 'copies column mappings' do - @table.map_column!('one') { |v| v.to_i } + @table.map_column!('one', &:to_i) table2 = @table.map_headers('one' => 'three') expect( table2.hashes.first['three'] ).to eq 4444 end it 'takes a block and operates on all the headers with it' do - table2 = table.map_headers do |header| - header.downcase - end + table2 = table.map_headers(&:downcase) expect( table2.hashes.first.keys ).to match %w[hello world] end it 'treats the mappings in the provided hash as overrides when used with a block' do - table2 = table.map_headers('WORLD' => 'foo') do |header| - header.downcase - end + table2 = table.map_headers('WORLD' => 'foo', &:downcase) expect( table2.hashes.first.keys ).to match %w[hello foo] end From 24e3a2ec659a02ee7797375178de19eac7e41d0f Mon Sep 17 00:00:00 2001 From: Matt Wynne Date: Wed, 18 Oct 2017 20:51:30 +0100 Subject: [PATCH 10/29] Try adding a publish job to Cucumber Pro We'll need to set up an SSH key, I just want to see if this circle config works --- .circleci/config.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3e76a3d2ac..ae634653d6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,6 +5,12 @@ version: 2.0 jobs: + publish: + machine: true + steps: + - checkout + - run: git remote add cucumber-pro git@git.cucumber.pro:cucumber-ruby.git + - run: git push cucumber-pro $CIRCLE_BRANCH "ruby-2.4.1": docker: - image: circleci/ruby:2.4.1 @@ -98,3 +104,4 @@ workflows: - "ruby-2.3.5" - "ruby-2.2.8" - "jruby-9.1.13.0" + - publish From 58f5cfc03c309a3b34c83240e92deb736573be42 Mon Sep 17 00:00:00 2001 From: Matt Wynne Date: Wed, 18 Oct 2017 23:31:40 +0100 Subject: [PATCH 11/29] Add a readme to the features dir --- features/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 features/README.md diff --git a/features/README.md b/features/README.md new file mode 100644 index 0000000000..ba332ae971 --- /dev/null +++ b/features/README.md @@ -0,0 +1,14 @@ +## Cucumber for Ruby + +Cucumber is a tool for running automated tests written in plain language. Because they're +written in plain language, they can be read by anyone on your team. Because they can be +read by anyone, you can use them to help improve communication, collaboration and trust on +your team. + +## Code of Conduct + +Everyone interacting in this codebase and issue tracker is expected to follow the Cucumber [code of conduct](https://github.com/cucumber/cucumber/blob/master/CODE_OF_CONDUCT.md). + +## Copyright + +Copyright (c) Cucumber Ltd. and Contributors. See LICENSE for details. From 5316295ce80be7a41026711b331d44306e1b4d58 Mon Sep 17 00:00:00 2001 From: Matt Wynne Date: Wed, 18 Oct 2017 23:32:08 +0100 Subject: [PATCH 12/29] Fix copyright --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0433bb4463..b30d81b72a 100644 --- a/README.md +++ b/README.md @@ -39,4 +39,4 @@ Everyone interacting in this codebase and issue tracker is expected to follow th ## Copyright -Copyright (c) Aslak Hellesøy and Contributors. See LICENSE for details. +Copyright (c) Cucumber Ltd. and Contributors. See LICENSE for details. From da3039557ea9644f156aa19d2595e4c600cb305c Mon Sep 17 00:00:00 2001 From: Matt Wynne Date: Wed, 18 Oct 2017 23:33:31 +0100 Subject: [PATCH 13/29] Whoops wrong place for features readme --- features/{ => docs}/README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename features/{ => docs}/README.md (100%) diff --git a/features/README.md b/features/docs/README.md similarity index 100% rename from features/README.md rename to features/docs/README.md From 8f3975070e6032d3bd170c23e2cb28525f90e2fe Mon Sep 17 00:00:00 2001 From: Matt Wynne Date: Wed, 18 Oct 2017 23:38:23 +0100 Subject: [PATCH 14/29] Tag out failing window scenarios --- features/docs/defining_steps/ambiguous_steps.feature | 5 +++-- features/docs/writing_support_code/before_hook.feature | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/features/docs/defining_steps/ambiguous_steps.feature b/features/docs/defining_steps/ambiguous_steps.feature index 8606f54577..58f119cef1 100644 --- a/features/docs/defining_steps/ambiguous_steps.feature +++ b/features/docs/defining_steps/ambiguous_steps.feature @@ -9,6 +9,7 @@ Feature: Ambiguous Steps to use. Use it with caution! + @todo-windows Scenario: Ambiguous steps Given a file named "features/ambiguous.feature" with: @@ -52,7 +53,7 @@ Feature: Ambiguous Steps """ - + @todo-windows Scenario: Ambiguous steps with guess mode Given a file named "features/ambiguous.feature" with: @@ -86,4 +87,4 @@ Feature: Ambiguous Steps 2 steps (2 passed) 0m0.012s - """ \ No newline at end of file + """ diff --git a/features/docs/writing_support_code/before_hook.feature b/features/docs/writing_support_code/before_hook.feature index 0d75839094..be7b5d31ea 100644 --- a/features/docs/writing_support_code/before_hook.feature +++ b/features/docs/writing_support_code/before_hook.feature @@ -30,6 +30,7 @@ Feature: Before Hook """ + @todo-windows Scenario: Examine names of scenario outline and feature Given a file named "features/foo.feature" with: """ From c3040acd3cca907c79455863a0d69748193fdb5b Mon Sep 17 00:00:00 2001 From: Jayson Smith Date: Wed, 18 Oct 2017 20:37:54 -0700 Subject: [PATCH 15/29] Add contributions from jaysonesmith to changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20521250d2..bf5c29904e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo ### Changed +* Fix SymbolProc issues ([#1212](https://github.com/cucumber/cucumber-ruby/pull/1212) [@jaysonesmith](https://github.com/jaysonesmith)) +* Fix TrailingBlankLines ([#1211](https://github.com/cucumber/cucumber-ruby/pull/1211) [@jaysonesmith](https://github.com/jaysonesmith)) * N/A ### Deprecated @@ -30,6 +32,7 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo ### Fixed +* Change test expectation to handle Ruby's unstable sorting ([#1210](https://github.com/cucumber/cucumber-ruby/pull/1210) [@jaysonesmith](https://github.com/jaysonesmith)) * Fix the printing of newlines in the rerun formatter - a problem introduced in [#1162](https://github.com/cucumber/cucumber-ruby/issues/1162) ([#1207](https://github.com/cucumber/cucumber-ruby/issues/1207) [@brasmusson](https://github.com/brasmusson)) * Handle the `--retry` option in profiles ([#1050](https://github.com/cucumber/cucumber-ruby/issues/1050) [@brasmusson](https://github.com/brasmusson)) From 8bf065d2530704c4e2a81fae74ba662cec3b6e51 Mon Sep 17 00:00:00 2001 From: Alex Mikitenko Date: Wed, 11 Oct 2017 18:52:42 -0700 Subject: [PATCH 16/29] Fix html reporter with more than one embedded screenshot There was typo in #next_id: @indices used incorrect key for incrementing screenshot number (:type as a symbol instead of type as a variable) --- lib/cucumber/formatter/html.rb | 2 +- spec/cucumber/formatter/html_spec.rb | 38 +++++++++++++++++++++++++--- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/lib/cucumber/formatter/html.rb b/lib/cucumber/formatter/html.rb index 321515acbe..8c94d064b7 100644 --- a/lib/cucumber/formatter/html.rb +++ b/lib/cucumber/formatter/html.rb @@ -399,7 +399,7 @@ def after_test_case(_test_case, result) def next_id(type) @indices ||= Hash.new { 0 } @indices[type] += 1 - "#{type}_#{@indices[:type]}" + "#{type}_#{@indices[type]}" end def build_exception_detail(exception) diff --git a/spec/cucumber/formatter/html_spec.rb b/spec/cucumber/formatter/html_spec.rb index 0c4d608ae6..d9120a8bd3 100644 --- a/spec/cucumber/formatter/html_spec.rb +++ b/spec/cucumber/formatter/html_spec.rb @@ -33,12 +33,15 @@ module Formatter describe 'when writing the report to a file' do before(:each) do allow(@out).to receive(:respond_to?).with(:path).and_return(true) - expect(@out).to receive(:path).and_return('out/file.html') - run_defined_feature - @doc = Nokogiri.HTML(@out.string) end describe 'with a step that embeds a snapshot' do + before(:each) do + expect(@out).to receive(:path).and_return('out/file.html') + run_defined_feature + @doc = Nokogiri.HTML(@out.string) + end + define_steps do Given(/snap/) { RSpec::Mocks.allow_message(File, :file?) { true } @@ -56,6 +59,33 @@ module Formatter expect(@doc.css('.embed img').first.attributes['src'].to_s).to eq 'snapshot.jpeg' end end + + describe 'with more than one step that embeds snapshot' do + before(:each) do + expect(@out).to receive(:path).twice.and_return('out/file.html') + run_defined_feature + @doc = Nokogiri.HTML(@out.string) + end + + define_steps do + Given(/snap/) { + RSpec::Mocks.allow_message(File, :file?) { true } + embed('out/snapshot.jpeg', 'image/jpeg') + } + end + + define_feature(<<-FEATURE) + Feature: + Scenario: + Given snap + And snap + FEATURE + + it 'specifies id for img incrementally' do + ids = @doc.css('img').map { |element| element.attributes['id'].to_s } + expect(ids).to match %w(img_1 img_2) + end + end end describe 'given a single feature' do @@ -364,7 +394,7 @@ module Formatter Given log FEATURE - it { expect(@doc.at('a#text_0')['href'].to_s).to eq 'log.txt' } + it { expect(@doc.at('a#text_1')['href'].to_s).to eq 'log.txt' } end describe 'with a step that embeds a snapshot content manually' do From e69acaf18be19c64be2577a3f7225828747d4762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aslak=20Helles=C3=B8y?= Date: Fri, 20 Oct 2017 09:41:59 +0100 Subject: [PATCH 17/29] Remove Appveyor badge The Appveyor badge shows "failing" even though the build is passing. According to appveyor/ci#1525 they are completely broken. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index b30d81b72a..74d8d6b886 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ [![OpenCollective](https://opencollective.com/cucumber/sponsors/badge.svg)](https://opencollective.com/cucumber) [![CircleCI](https://circleci.com/gh/cucumber/cucumber-ruby.svg?style=svg)](https://circleci.com/gh/cucumber/cucumber-ruby) -[![Windows Build Status](https://ci.appveyor.com/api/projects/status/ncqhcevrv93hhu5j?svg=true)](https://ci.appveyor.com/project/cucumberbdd/cucumber-ruby) [![Code Climate](https://codeclimate.com/github/cucumber/cucumber-ruby.svg)](https://codeclimate.com/github/cucumber/cucumber-ruby) [![Coverage Status](https://coveralls.io/repos/cucumber/cucumber-ruby/badge.svg?branch=master)](https://coveralls.io/r/cucumber/cucumber-ruby?branch=master) From 21c98c062c31f613800ee6d0b0074562dd5caa9a Mon Sep 17 00:00:00 2001 From: Jayson Smith Date: Wed, 25 Oct 2017 22:05:35 -0500 Subject: [PATCH 18/29] Review and handle excluded/ignored cops (#1208) * Shift AmbiguousOperator cop and disable - Moved to rubocop.yml * Inline other reviewed cop violations * Push changed with inlined cops * Move excluded cops and remove some inlines * Add info to trailingwhitespace cop --- .rubocop.yml | 24 ++++++++++++++ .rubocop_todo.yml | 32 ------------------- .../step_definitions/calculator_steps.rb | 3 -- .../step_definitions/calculator_steps.rb | 3 -- .../step_definitions/calculator_steps.rb | 3 -- spec/cucumber/formatter/pretty_spec.rb | 10 ------ spec/cucumber/formatter/progress_spec.rb | 2 -- 7 files changed, 24 insertions(+), 53 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 16c6dc9a76..0622f3e11d 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -12,3 +12,27 @@ AllCops: Exclude: - 'tmp/**/*' - 'vendor/**/*' + +# Reviewed: please see PR-1022 for details on why this cop is disabled: https://github.com/cucumber/cucumber-ruby/pull/1022 +Lint/AmbiguousOperator: + Enabled: False + +# Reviewed: in pretty_spec.rb, progress_spec.rb offences look false, +# as the trailing spaces are in multiline string literals +Style/TrailingWhitespace: + Exclude: + - 'spec/cucumber/formatter/pretty_spec.rb' + - 'spec/cucumber/formatter/progress_spec.rb' + +# Reviewed: these offenses look false as the variables are in cyrillic +Style/VariableName: + Exclude: + - 'examples/i18n/ru/features/step_definitions/calculator_steps.rb' + - 'examples/i18n/uk/features/step_definitions/calculator_steps.rb' + - 'examples/i18n/uz/features/step_definitions/calculator_steps.rb' + +# Reviewed: Formatters put trailing spaces after things like 'Feature: ' +Style/TrailingWhitespace: + Exclude: + - 'spec/cucumber/formatter/pretty_spec.rb' + - 'spec/cucumber/formatter/progress_spec.rb' diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 17646c0b5d..4dc16301ee 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -6,15 +6,6 @@ # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 8 -Lint/AmbiguousOperator: - Exclude: - - 'lib/cucumber/formatter/legacy_api/adapter.rb' - - 'lib/cucumber/multiline_argument/data_table.rb' - - 'lib/cucumber/running_test_case.rb' - - 'spec/cucumber/formatter/legacy_api/adapter_spec.rb' - - 'spec/cucumber/formatter/spec_helper.rb' - # Offense count: 2 Lint/Eval: Exclude: @@ -950,26 +941,3 @@ Style/StructInheritance: # SupportedStyles: final_newline, final_blank_line Style/TrailingBlankLines: Enabled: false - -# Offense count: 18 -# Cop supports --auto-correct. -# Reviewed: in pretty_spec.rb, progress_spec.rb offences look false, -# as the trailing spaces are in multiline string literals -Style/TrailingWhitespace: - Exclude: - - 'spec/cucumber/formatter/pretty_spec.rb' - - 'spec/cucumber/formatter/progress_spec.rb' - -# Offense count: 1 -# Cop supports --auto-correct. -# Reviewed: when the offense is fixed there is one spec failing (./spec/cucumber/rb_support/rb_world_spec.rb:37) -Style/UnneededInterpolation: - Exclude: - - 'lib/cucumber/glue/proto_world.rb' - -# Offense count: 15 -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: snake_case, camelCase -# Reviewed: these offenses look false as the variables are in cyrillic -Style/VariableName: - Enabled: false \ No newline at end of file diff --git a/examples/i18n/ru/features/step_definitions/calculator_steps.rb b/examples/i18n/ru/features/step_definitions/calculator_steps.rb index 45ed04f3aa..2eb87c39e2 100644 --- a/examples/i18n/ru/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/ru/features/step_definitions/calculator_steps.rb @@ -1,5 +1,4 @@ # encoding: utf-8 -# rubocop:disable VariableName Допустим(/ввожу число (\d+)/) do |число| calc.push число.to_i @@ -18,5 +17,3 @@ Допустим %{затем ввожу число #{слагаемое2}} Допустим %{я нажимаю "+"} end - -# rubocop:enable VariableName diff --git a/examples/i18n/uk/features/step_definitions/calculator_steps.rb b/examples/i18n/uk/features/step_definitions/calculator_steps.rb index d28cb1f6af..95767e119c 100644 --- a/examples/i18n/uk/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/uk/features/step_definitions/calculator_steps.rb @@ -1,5 +1,4 @@ # encoding: utf-8 -# rubocop:disable VariableName Припустимо(/ввожу число (\d+)/) do |число| calc.push число.to_i @@ -18,5 +17,3 @@ Припустимо %{потім ввожу число #{доданок2}} Припустимо %{я натискаю "+"} end - -# rubocop:enable VariableName diff --git a/examples/i18n/uz/features/step_definitions/calculator_steps.rb b/examples/i18n/uz/features/step_definitions/calculator_steps.rb index ecf196217d..70541d8d41 100644 --- a/examples/i18n/uz/features/step_definitions/calculator_steps.rb +++ b/examples/i18n/uz/features/step_definitions/calculator_steps.rb @@ -1,5 +1,4 @@ # encoding: utf-8 -# rubocop:disable VariableName Агар(/(\d+) сонини киритсам/) do |сон| calc.push сон.to_i @@ -18,5 +17,3 @@ Агар %{ундан сунг #{кушилувчи2} сонини киритсам} Агар %{"+"ни боссам} end - -# rubocop:enable VariableName diff --git a/spec/cucumber/formatter/pretty_spec.rb b/spec/cucumber/formatter/pretty_spec.rb index b6db77bbee..b8d15595e1 100644 --- a/spec/cucumber/formatter/pretty_spec.rb +++ b/spec/cucumber/formatter/pretty_spec.rb @@ -39,7 +39,6 @@ module Formatter end end - # rubocop:disable TrailingWhitespace describe 'with a background' do define_feature <<-FEATURE Feature: Banana party @@ -63,7 +62,6 @@ module Formatter expect(@out.string).to include 'Given there are bananas' end end - # rubocop:enable TrailingWhitespace describe 'with a scenario outline' do define_feature <<-FEATURE @@ -295,7 +293,6 @@ module Formatter Given('this step passes') {} end - # rubocop:disable TrailingWhitespace it 'displays hook output appropriately ' do expect( @out.string ).to include < Date: Wed, 25 Oct 2017 22:18:49 -0500 Subject: [PATCH 19/29] Changelog update --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf5c29904e..8a82eab579 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo ### Changed +* Review and handle excluded/ignored cops ([#1208](https://github.com/cucumber/cucumber-ruby/pull/1208) [@jaysonesmith](https://github.com/jaysonesmith)) * Fix SymbolProc issues ([#1212](https://github.com/cucumber/cucumber-ruby/pull/1212) [@jaysonesmith](https://github.com/jaysonesmith)) * Fix TrailingBlankLines ([#1211](https://github.com/cucumber/cucumber-ruby/pull/1211) [@jaysonesmith](https://github.com/jaysonesmith)) * N/A From 3f178bba7f19cbb18d6196f2f0b118ef4802039f Mon Sep 17 00:00:00 2001 From: Jayson Smith Date: Wed, 25 Oct 2017 22:28:21 -0500 Subject: [PATCH 20/29] Remove TrailingBlankLines entry from todo --- .rubocop_todo.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 4dc16301ee..e745c1e013 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -933,11 +933,4 @@ Style/StringLiteralsInInterpolation: Style/StructInheritance: Exclude: - 'lib/cucumber/formatter/legacy_api/adapter.rb' - - 'lib/cucumber/formatter/legacy_api/runtime_facade.rb' - -# Offense count: 69 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: final_newline, final_blank_line -Style/TrailingBlankLines: - Enabled: false + - 'lib/cucumber/formatter/legacy_api/runtime_facade.rb' \ No newline at end of file From 39734f43a0f54417e7603eef4777a13c46c12d25 Mon Sep 17 00:00:00 2001 From: Jayson Smith Date: Fri, 27 Oct 2017 23:24:46 -0500 Subject: [PATCH 21/29] Exclude the legacy_api from rubocop, regenerate .rubocop_todo.yml. Update Changelog.md. Supersedes and closes #1225. --- .rubocop.yml | 2 + .rubocop_todo.yml | 243 ++++++++++++++++------------------------------ CHANGELOG.md | 10 +- 3 files changed, 95 insertions(+), 160 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 0622f3e11d..313c27a187 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -12,6 +12,8 @@ AllCops: Exclude: - 'tmp/**/*' - 'vendor/**/*' + - 'lib/cucumber/formatter/legacy_api/*' + - 'spec/cucumber/formatter/legacy_api/*' # Reviewed: please see PR-1022 for details on why this cop is disabled: https://github.com/cucumber/cucumber-ruby/pull/1022 Lint/AmbiguousOperator: diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index e745c1e013..96ec39ab85 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2016-11-26 12:42:16 +0000 using RuboCop version 0.40.0. +# on 2017-10-29 18:15:53 +0100 using RuboCop version 0.40.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -12,10 +12,9 @@ Lint/Eval: - 'lib/cucumber/formatter/ansicolor.rb' - 'lib/cucumber/term/ansicolor.rb' -# Offense count: 2 +# Offense count: 1 Lint/HandleExceptions: Exclude: - - 'features/lib/step_definitions/wire_steps.rb' - 'lib/cucumber/rake/task.rb' # Offense count: 2 @@ -29,14 +28,14 @@ Lint/Loop: Exclude: - 'lib/autotest/cucumber_mixin.rb' -# Offense count: 7 +# Offense count: 6 Lint/RescueException: Exclude: - 'features/lib/support/fake_wire_server.rb' - 'lib/cucumber/cli/main.rb' - 'lib/cucumber/configuration.rb' - - 'lib/cucumber/glue/invoke_in_world.rb' - 'lib/cucumber/formatter/ansicolor.rb' + - 'lib/cucumber/glue/invoke_in_world.rb' - 'lib/cucumber/glue/proto_world.rb' # Offense count: 6 @@ -48,59 +47,54 @@ Lint/ShadowingOuterLocalVariable: - 'lib/cucumber/multiline_argument/data_table.rb' - 'spec/cucumber/step_match_spec.rb' -# Offense count: 71 +# Offense count: 44 # Cop supports --auto-correct. # Configuration parameters: AllowUnusedKeywordArguments. Lint/UnusedBlockArgument: Enabled: false -# Offense count: 61 +# Offense count: 52 Metrics/AbcSize: - Max: 100 - -# Offense count: 1 -Metrics/BlockNesting: - Max: 4 + Max: 52 -# Offense count: 10 +# Offense count: 11 # Configuration parameters: CountComments. Metrics/ClassLength: - Max: 534 + Max: 489 -# Offense count: 11 +# Offense count: 7 Metrics/CyclomaticComplexity: - Max: 17 + Max: 9 -# Offense count: 944 +# Offense count: 850 # Configuration parameters: AllowHeredoc, AllowURI, URISchemes. # URISchemes: http, https Metrics/LineLength: Max: 309 -# Offense count: 77 +# Offense count: 73 # Configuration parameters: CountComments. Metrics/MethodLength: - Max: 63 + Max: 62 -# Offense count: 19 +# Offense count: 17 # Configuration parameters: CountComments. Metrics/ModuleLength: - Max: 1976 + Max: 747 -# Offense count: 7 +# Offense count: 5 # Configuration parameters: CountKeywordArgs. Metrics/ParameterLists: Max: 8 -# Offense count: 9 +# Offense count: 6 Metrics/PerceivedComplexity: - Max: 18 + Max: 11 -# Offense count: 3 +# Offense count: 1 # Cop supports --auto-correct. Performance/RedundantBlockCall: Exclude: - - 'lib/cucumber/formatter/legacy_api/adapter.rb' - 'lib/cucumber/step_match.rb' # Offense count: 3 @@ -116,7 +110,6 @@ Style/AccessorMethodName: - 'lib/autotest/cucumber_mixin.rb' - 'lib/cucumber/cli/options.rb' - 'lib/cucumber/formatter/html.rb' - - 'lib/cucumber/formatter/legacy_api/adapter.rb' # Offense count: 3 # Cop supports --auto-correct. @@ -126,7 +119,7 @@ Style/Alias: Exclude: - 'lib/cucumber/formatter/ansicolor.rb' -# Offense count: 20 +# Offense count: 19 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: with_first_parameter, with_fixed_indentation @@ -137,18 +130,21 @@ Style/AlignParameters: - 'lib/cucumber/cli/options.rb' - 'lib/cucumber/runtime/for_programming_languages.rb' -# Offense count: 19 +# Offense count: 23 Style/AsciiComments: Exclude: - 'lib/cucumber/encoding.rb' - - 'lib/cucumber/events/*' + - 'lib/cucumber/events/gherkin_source_read.rb' + - 'lib/cucumber/events/step_activated.rb' + - 'lib/cucumber/events/step_definition_registered.rb' + - 'lib/cucumber/events/test_run_finished.rb' + - 'lib/cucumber/events/test_run_started.rb' + - 'lib/cucumber/events/test_step_started.rb' - 'lib/cucumber/filters/randomizer.rb' - 'lib/cucumber/formatter/html.rb' - - 'lib/cucumber/formatter/legacy_api/adapter.rb' - 'lib/cucumber/glue/step_definition.rb' - 'lib/cucumber/running_test_case.rb' - 'lib/cucumber/runtime.rb' - - 'spec/cucumber/formatter/legacy_api/adapter_spec.rb' - 'spec/cucumber/step_match_search_spec.rb' # Offense count: 73 @@ -179,7 +175,7 @@ Style/BarePercentLiterals: Exclude: - 'lib/cucumber/term/ansicolor.rb' -# Offense count: 56 +# Offense count: 47 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, ProceduralMethods, FunctionalMethods, IgnoredMethods. # SupportedStyles: line_count_based, semantic, braces_for_chaining @@ -196,7 +192,7 @@ Style/BlockEndNewline: - 'spec/cucumber/formatter/json_spec.rb' - 'spec/cucumber/rake/forked_spec.rb' -# Offense count: 45 +# Offense count: 43 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: braces, no_braces, context_dependent @@ -211,10 +207,9 @@ Style/BracesAroundHashParameters: - 'spec/cucumber/formatter/html_spec.rb' - 'spec/cucumber/formatter/junit_spec.rb' - 'spec/cucumber/formatter/pretty_spec.rb' - - 'spec/cucumber/multiline_argument/data_table_spec.rb' - 'spec/cucumber/glue/step_definition_spec.rb' -# Offense count: 12 +# Offense count: 11 Style/CaseEquality: Exclude: - 'lib/cucumber/formatter/console.rb' @@ -230,12 +225,11 @@ Style/CharacterLiteral: Exclude: - 'lib/autotest/cucumber_mixin.rb' -# Offense count: 12 +# Offense count: 10 # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: nested, compact Style/ClassAndModuleChildren: Exclude: - - 'gem_tasks/cucumber.rake' - 'lib/autotest/cucumber.rb' - 'lib/autotest/cucumber_mixin.rb' - 'lib/autotest/cucumber_rails.rb' @@ -245,13 +239,12 @@ Style/ClassAndModuleChildren: - 'lib/autotest/cucumber_rspec2.rb' - 'spec/cucumber/formatter/fail_fast_spec.rb' - 'spec/cucumber/formatter/interceptor_spec.rb' - - 'spec/cucumber/formatter/legacy_api/adapter_spec.rb' - 'spec/cucumber/hooks_spec.rb' # Offense count: 2 Style/ClassVars: Exclude: - - 'lib/cucumber/formatter/html.rb' + - 'lib/cucumber/formatter/html.rb' # Offense count: 1 # Cop supports --auto-correct. @@ -259,11 +252,11 @@ Style/DefWithParentheses: Exclude: - 'lib/cucumber/cli/options.rb' -# Offense count: 186 +# Offense count: 169 Style/Documentation: Enabled: false -# Offense count: 12 +# Offense count: 8 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: leading, trailing @@ -281,68 +274,48 @@ Style/EachWithObject: - 'lib/cucumber/formatter/steps.rb' - 'lib/cucumber/glue/registry_and_more.rb' -# Offense count: 12 -# Cop supports --auto-correct. -# Configuration parameters: AllowAdjacentOneLineDefs. -Style/EmptyLineBetweenDefs: - Exclude: - - 'lib/cucumber/formatter/legacy_api/adapter.rb' - -# Offense count: 14 +# Offense count: 9 # Cop supports --auto-correct. Style/EmptyLines: Exclude: - 'lib/cucumber/cli/main.rb' - 'lib/cucumber/events/step_definition_registered.rb' - 'lib/cucumber/formatter/backtrace_filter.rb' - - 'lib/cucumber/formatter/html.rb' - - 'lib/cucumber/formatter/legacy_api/adapter.rb' - 'lib/cucumber/multiline_argument/data_table.rb' - 'lib/cucumber/multiline_argument/data_table/diff_matrices.rb' - 'lib/cucumber/term/ansicolor.rb' - - 'spec/cucumber/formatter/legacy_api/adapter_spec.rb' - - 'spec/cucumber/formatter/pretty_spec.rb' - 'spec/cucumber/runtime/support_code_spec.rb' -# Offense count: 6 +# Offense count: 3 # Cop supports --auto-correct. Style/EmptyLinesAroundAccessModifier: Exclude: - 'lib/cucumber/formatter/interceptor.rb' - - 'lib/cucumber/formatter/legacy_api/adapter.rb' - - 'lib/cucumber/multiline_argument/data_table.rb' - - 'lib/cucumber/glue/transform.rb' - 'lib/cucumber/runtime/step_hooks.rb' - 'lib/cucumber/step_match.rb' -# Offense count: 43 +# Offense count: 33 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: empty_lines, no_empty_lines Style/EmptyLinesAroundBlockBody: Enabled: false -# Offense count: 40 +# Offense count: 52 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: empty_lines, no_empty_lines Style/EmptyLinesAroundClassBody: Enabled: false -# Offense count: 1 -# Cop supports --auto-correct. -Style/EmptyLinesAroundMethodBody: - Exclude: - - 'lib/cucumber/formatter/legacy_api/ast.rb' - -# Offense count: 53 +# Offense count: 60 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: empty_lines, no_empty_lines Style/EmptyLinesAroundModuleBody: Enabled: false -# Offense count: 6 +# Offense count: 7 # Cop supports --auto-correct. Style/EmptyLiteral: Exclude: @@ -352,7 +325,7 @@ Style/EmptyLiteral: - 'lib/cucumber/glue/snippet.rb' - 'spec/cucumber/glue/registry_and_more_spec.rb' -# Offense count: 11 +# Offense count: 7 # Cop supports --auto-correct. # Configuration parameters: AllowForAlignment, ForceEqualSignAlignment. Style/ExtraSpacing: @@ -361,9 +334,6 @@ Style/ExtraSpacing: - 'spec/cucumber/formatter/html_spec.rb' - 'spec/cucumber/formatter/json_spec.rb' - 'spec/cucumber/formatter/junit_spec.rb' - - 'spec/cucumber/formatter/legacy_api/adapter_spec.rb' - - 'spec/cucumber/multiline_argument/data_table_spec.rb' - - 'spec/cucumber/glue/step_definition_spec.rb' # Offense count: 1 # Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts. @@ -388,18 +358,17 @@ Style/GlobalVars: - 'spec/cucumber/glue/registry_and_more_spec.rb' - 'spec/cucumber/glue/step_definition_spec.rb' -# Offense count: 10 +# Offense count: 9 # Configuration parameters: MinBodyLength. Style/GuardClause: Exclude: - 'lib/cucumber/constantize.rb' - 'lib/cucumber/formatter/html.rb' - 'lib/cucumber/formatter/junit.rb' - - 'lib/cucumber/formatter/legacy_api/adapter.rb' - 'lib/cucumber/formatter/pretty.rb' - 'lib/cucumber/glue/proto_world.rb' -# Offense count: 182 +# Offense count: 147 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues. # SupportedStyles: ruby19, ruby19_no_mixed_keys, hash_rockets @@ -413,7 +382,7 @@ Style/IfInsideElse: - 'lib/cucumber/formatter/console.rb' - 'lib/cucumber/formatter/json.rb' -# Offense count: 15 +# Offense count: 12 # Cop supports --auto-correct. # Configuration parameters: MaxLineLength. Style/IfUnlessModifier: @@ -423,19 +392,17 @@ Style/IfUnlessModifier: - 'lib/cucumber/formatter/ansicolor.rb' - 'lib/cucumber/formatter/backtrace_filter.rb' - 'lib/cucumber/formatter/html.rb' - - 'lib/cucumber/formatter/legacy_api/adapter.rb' - 'lib/cucumber/gherkin/formatter/ansi_escapes.rb' - 'lib/cucumber/rake/task.rb' - - 'spec/cucumber/formatter/legacy_api/adapter_spec.rb' -# Offense count: 89 +# Offense count: 49 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. # SupportedStyles: special_inside_parentheses, consistent, align_brackets Style/IndentArray: Enabled: false -# Offense count: 4 +# Offense count: 6 # Cop supports --auto-correct. # Configuration parameters: SupportedStyles, IndentationWidth. # SupportedStyles: special_inside_parentheses, consistent, align_braces @@ -454,21 +421,19 @@ Style/IndentationConsistency: - 'spec/cucumber/formatter/json_spec.rb' - 'spec/cucumber/step_match_search_spec.rb' -# Offense count: 9 +# Offense count: 7 # Cop supports --auto-correct. # Configuration parameters: Width. Style/IndentationWidth: Exclude: - - 'lib/cucumber/formatter/legacy_api/adapter.rb' - 'lib/cucumber/gherkin/formatter/ansi_escapes.rb' - 'lib/cucumber/gherkin/formatter/escaping.rb' - - 'lib/cucumber/glue/transform.rb' - 'spec/cucumber/cli/configuration_spec.rb' - 'spec/cucumber/multiline_argument/data_table_spec.rb' - 'spec/cucumber/step_match_search_spec.rb' - 'spec/cucumber/world/pending_spec.rb' -# Offense count: 40 +# Offense count: 28 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: line_count_dependent, lambda, literal @@ -476,20 +441,18 @@ Style/Lambda: Exclude: - 'features/lib/support/fake_wire_server.rb' - 'lib/cucumber/formatter/html.rb' - - 'lib/cucumber/multiline_argument/data_table.rb' - 'lib/cucumber/glue/step_definition.rb' + - 'lib/cucumber/multiline_argument/data_table.rb' - 'lib/cucumber/step_match.rb' - 'spec/cucumber/formatter/html_spec.rb' - 'spec/cucumber/formatter/junit_spec.rb' - - 'spec/cucumber/multiline_argument/data_table_spec.rb' - 'spec/cucumber/glue/registry_and_more_spec.rb' - 'spec/cucumber/glue/step_definition_spec.rb' - - 'spec/cucumber/rb_support/rb_transform_spec.rb' - 'spec/cucumber/step_match_search_spec.rb' - 'spec/cucumber/step_match_spec.rb' - 'spec/cucumber/world/pending_spec.rb' -# Offense count: 38 +# Offense count: 42 # Cop supports --auto-correct. Style/LeadingCommentSpace: Enabled: false @@ -508,7 +471,7 @@ Style/MethodCallParentheses: - 'lib/cucumber/cli/configuration.rb' - 'lib/cucumber/cli/options.rb' -# Offense count: 12 +# Offense count: 11 # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: snake_case, camelCase Style/MethodName: @@ -520,13 +483,12 @@ Style/ModuleFunction: - 'lib/cucumber/gherkin/formatter/ansi_escapes.rb' - 'lib/cucumber/term/ansicolor.rb' -# Offense count: 3 +# Offense count: 1 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: symmetrical, new_line, same_line Style/MultilineArrayBraceLayout: Exclude: - - 'lib/cucumber/cli/options.rb' - 'spec/cucumber/configuration_spec.rb' # Offense count: 2 @@ -548,7 +510,7 @@ Style/MultilineIfThen: Exclude: - 'lib/autotest/cucumber_mixin.rb' -# Offense count: 9 +# Offense count: 7 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: symmetrical, new_line, same_line @@ -556,7 +518,6 @@ Style/MultilineMethodCallBraceLayout: Exclude: - 'lib/cucumber/cli/options.rb' - 'lib/cucumber/formatter/junit.rb' - - 'lib/cucumber/formatter/legacy_api/ast.rb' - 'lib/cucumber/runtime.rb' - 'spec/cucumber/configuration_spec.rb' - 'spec/cucumber/formatter/spec_helper.rb' @@ -569,7 +530,7 @@ Style/MultilineMethodCallBraceLayout: Style/MultilineMethodCallIndentation: Enabled: false -# Offense count: 8 +# Offense count: 5 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. # SupportedStyles: aligned, indented @@ -594,12 +555,11 @@ Style/MutableConstant: - 'lib/cucumber/term/ansicolor.rb' - 'spec/cucumber/step_match_spec.rb' -# Offense count: 7 +# Offense count: 3 # Cop supports --auto-correct. Style/NegatedIf: Exclude: - 'lib/cucumber/formatter/io.rb' - - 'lib/cucumber/formatter/legacy_api/adapter.rb' - 'lib/cucumber/rake/task.rb' - 'lib/cucumber/runtime.rb' @@ -609,7 +569,7 @@ Style/NestedParenthesizedCalls: Exclude: - 'spec/cucumber/hooks_spec.rb' -# Offense count: 8 +# Offense count: 7 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, MinBodyLength, SupportedStyles. # SupportedStyles: skip_modifier_ifs, always @@ -619,16 +579,14 @@ Style/Next: - 'features/lib/support/normalise_output.rb' - 'lib/autotest/cucumber_mixin.rb' - 'lib/cucumber/formatter/ansicolor.rb' - - 'lib/cucumber/multiline_argument/data_table.rb' - 'spec/cucumber/formatter/json_spec.rb' -# Offense count: 4 +# Offense count: 2 # Cop supports --auto-correct. Style/Not: Exclude: - 'lib/cucumber/formatter/console.rb' - 'lib/cucumber/formatter/html.rb' - - 'lib/cucumber/formatter/legacy_api/adapter.rb' # Offense count: 3 # Cop supports --auto-correct. @@ -638,16 +596,16 @@ Style/NumericLiterals: # Offense count: 5 Style/OpMethod: Exclude: - - 'lib/cucumber/multiline_argument/data_table.rb' - 'lib/cucumber/glue/step_definition.rb' + - 'lib/cucumber/multiline_argument/data_table.rb' - 'lib/cucumber/step_definition_light.rb' -# Offense count: 25 +# Offense count: 22 # Cop supports --auto-correct. Style/ParallelAssignment: Enabled: false -# Offense count: 225 +# Offense count: 232 # Cop supports --auto-correct. # Configuration parameters: PreferredDelimiters. Style/PercentLiteralDelimiters: @@ -682,22 +640,21 @@ Style/Proc: Exclude: - 'spec/cucumber/filters/activate_steps_spec.rb' -# Offense count: 7 +# Offense count: 9 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: compact, exploded Style/RaiseArgs: Enabled: false -# Offense count: 8 +# Offense count: 7 # Cop supports --auto-correct. Style/RedundantBegin: Exclude: - 'features/lib/support/fake_wire_server.rb' - - 'lib/cucumber/glue/invoke_in_world.rb' - 'lib/cucumber/formatter/ansicolor.rb' - 'lib/cucumber/formatter/unicode.rb' - - 'lib/cucumber/multiline_argument/data_table.rb' + - 'lib/cucumber/glue/invoke_in_world.rb' - 'lib/cucumber/glue/step_definition.rb' - 'lib/cucumber/runtime.rb' - 'lib/cucumber/runtime/user_interface.rb' @@ -708,25 +665,22 @@ Style/RedundantException: Exclude: - 'spec/cucumber/formatter/json_spec.rb' -# Offense count: 2 +# Offense count: 1 # Cop supports --auto-correct. Style/RedundantParentheses: Exclude: - 'lib/cucumber/formatter/html.rb' - - 'lib/cucumber/multiline_argument/data_table.rb' -# Offense count: 8 +# Offense count: 5 # Cop supports --auto-correct. # Configuration parameters: AllowMultipleReturnValues. Style/RedundantReturn: Exclude: - 'lib/autotest/cucumber_mixin.rb' - 'lib/cucumber/cli/profile_loader.rb' - - 'lib/cucumber/formatter/legacy_api/adapter.rb' - - 'lib/cucumber/multiline_argument/data_table.rb' - 'lib/cucumber/step_match.rb' -# Offense count: 20 +# Offense count: 19 # Cop supports --auto-correct. Style/RedundantSelf: Exclude: @@ -735,14 +689,13 @@ Style/RedundantSelf: - 'lib/cucumber/errors.rb' - 'lib/cucumber/filters/activate_steps.rb' - 'lib/cucumber/formatter/interceptor.rb' - - 'lib/cucumber/formatter/legacy_api/ast.rb' + - 'lib/cucumber/glue/proto_world.rb' + - 'lib/cucumber/glue/step_definition.rb' - 'lib/cucumber/multiline_argument/data_table.rb' - 'lib/cucumber/multiline_argument/doc_string.rb' - - 'lib/cucumber/glue/step_definition.rb' - - 'lib/cucumber/glue/proto_world.rb' - 'spec/cucumber/running_test_case_spec.rb' -# Offense count: 18 +# Offense count: 16 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes. # SupportedStyles: slashes, percent_r, mixed @@ -753,11 +706,10 @@ Style/RegexpLiteral: - 'lib/cucumber/formatter/backtrace_filter.rb' - 'lib/cucumber/formatter/html.rb' - 'lib/cucumber/formatter/junit.rb' - - 'lib/cucumber/formatter/legacy_api/adapter.rb' - 'lib/cucumber/runtime.rb' - 'spec/cucumber/formatter/html_spec.rb' - - 'spec/cucumber/project_initializer_spec.rb' - 'spec/cucumber/glue/registry_and_more_spec.rb' + - 'spec/cucumber/project_initializer_spec.rb' # Offense count: 2 # Cop supports --auto-correct. @@ -773,7 +725,6 @@ Style/Semicolon: Exclude: - 'spec/cucumber/cli/options_spec.rb' - 'spec/cucumber/formatter/json_spec.rb' - - 'spec/cucumber/formatter/legacy_api/adapter_spec.rb' # Offense count: 4 # Cop supports --auto-correct. @@ -791,56 +742,43 @@ Style/SignalException: Style/SingleLineBlockParams: Enabled: false -# Offense count: 4 +# Offense count: 2 # Cop supports --auto-correct. # Configuration parameters: AllowIfMethodIsEmpty. Style/SingleLineMethods: Exclude: - 'lib/cucumber/formatter/html.rb' - - 'lib/cucumber/formatter/legacy_api/adapter.rb' - 'lib/cucumber/rspec/disable_option_parser.rb' -# Offense count: 78 +# Offense count: 90 # Cop supports --auto-correct. Style/SpaceAfterComma: Enabled: false -# Offense count: 4 +# Offense count: 2 # Cop supports --auto-correct. Style/SpaceAfterNot: Exclude: - 'lib/cucumber/formatter/console.rb' - 'lib/cucumber/formatter/html.rb' - - 'lib/cucumber/formatter/legacy_api/adapter.rb' - -# Offense count: 16 -# Cop supports --auto-correct. -Style/SpaceAfterSemicolon: - Exclude: - - 'lib/cucumber/formatter/legacy_api/adapter.rb' -# Offense count: 30 +# Offense count: 32 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: space, no_space Style/SpaceAroundEqualsInParameterDefault: Enabled: false -# Offense count: 12 +# Offense count: 6 # Cop supports --auto-correct. Style/SpaceAroundKeyword: Exclude: - 'lib/cucumber/cli/options.rb' - - 'lib/cucumber/cli/profile_loader.rb' - - 'lib/cucumber/formatter/html.rb' - - 'lib/cucumber/formatter/legacy_api/results.rb' - - 'lib/cucumber/multiline_argument/data_table.rb' - 'lib/cucumber/rake/task.rb' - - 'lib/cucumber/glue/registry_and_more.rb' - 'lib/cucumber/runtime/user_interface.rb' - 'spec/cucumber/cli/profile_loader_spec.rb' -# Offense count: 25 +# Offense count: 24 # Cop supports --auto-correct. # Configuration parameters: AllowForAlignment. Style/SpaceAroundOperators: @@ -848,20 +786,20 @@ Style/SpaceAroundOperators: - 'examples/i18n/Rakefile' - 'examples/i18n/pt/lib/calculadora.rb' - 'lib/cucumber/cli/options.rb' - - 'lib/cucumber/glue/invoke_in_world.rb' - 'lib/cucumber/formatter/ansicolor.rb' - 'lib/cucumber/formatter/console.rb' - 'lib/cucumber/formatter/html.rb' - 'lib/cucumber/formatter/interceptor.rb' - 'lib/cucumber/formatter/json.rb' - 'lib/cucumber/formatter/pretty.rb' + - 'lib/cucumber/glue/invoke_in_world.rb' - 'lib/cucumber/glue/snippet.rb' - 'lib/cucumber/step_definition_light.rb' - 'spec/cucumber/cli/configuration_spec.rb' - - 'spec/cucumber/multiline_argument/data_table_spec.rb' - 'spec/cucumber/glue/step_definition_spec.rb' + - 'spec/cucumber/multiline_argument/data_table_spec.rb' -# Offense count: 88 +# Offense count: 78 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: space, no_space @@ -874,14 +812,14 @@ Style/SpaceBeforeComma: Exclude: - 'lib/cucumber/term/ansicolor.rb' -# Offense count: 255 +# Offense count: 208 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters. # SupportedStyles: space, no_space Style/SpaceInsideBlockBraces: Enabled: false -# Offense count: 84 +# Offense count: 75 # Cop supports --auto-correct. Style/SpaceInsideBrackets: Exclude: @@ -892,45 +830,36 @@ Style/SpaceInsideBrackets: - 'lib/cucumber/formatter/steps.rb' - 'lib/cucumber/rake/task.rb' - 'lib/cucumber/term/ansicolor.rb' - - 'spec/cucumber/formatter/legacy_api/adapter_spec.rb' - 'spec/cucumber/multiline_argument/data_table_spec.rb' -# Offense count: 92 +# Offense count: 82 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SupportedStyles. # SupportedStyles: space, no_space Style/SpaceInsideHashLiteralBraces: Enabled: false -# Offense count: 203 +# Offense count: 109 # Cop supports --auto-correct. Style/SpaceInsideParens: Exclude: - 'lib/cucumber/formatter/junit.rb' - 'lib/cucumber/step_match.rb' - - 'spec/cucumber/formatter/legacy_api/adapter_spec.rb' - 'spec/cucumber/formatter/pretty_spec.rb' - 'spec/cucumber/formatter/rerun_spec.rb' - 'spec/cucumber/hooks_spec.rb' - 'spec/cucumber/multiline_argument/data_table_spec.rb' - - 'spec/cucumber/rb_support/rb_world_spec.rb' -# Offense count: 89 +# Offense count: 91 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: use_perl_names, use_english_names Style/SpecialGlobalVars: Enabled: false -# Offense count: 14 +# Offense count: 15 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: single_quotes, double_quotes Style/StringLiteralsInInterpolation: Enabled: false - -# Offense count: 3 -Style/StructInheritance: - Exclude: - - 'lib/cucumber/formatter/legacy_api/adapter.rb' - - 'lib/cucumber/formatter/legacy_api/runtime_facade.rb' \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a82eab579..4f944c02a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,9 +18,6 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo ### Changed -* Review and handle excluded/ignored cops ([#1208](https://github.com/cucumber/cucumber-ruby/pull/1208) [@jaysonesmith](https://github.com/jaysonesmith)) -* Fix SymbolProc issues ([#1212](https://github.com/cucumber/cucumber-ruby/pull/1212) [@jaysonesmith](https://github.com/jaysonesmith)) -* Fix TrailingBlankLines ([#1211](https://github.com/cucumber/cucumber-ruby/pull/1211) [@jaysonesmith](https://github.com/jaysonesmith)) * N/A ### Deprecated @@ -37,6 +34,13 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo * Fix the printing of newlines in the rerun formatter - a problem introduced in [#1162](https://github.com/cucumber/cucumber-ruby/issues/1162) ([#1207](https://github.com/cucumber/cucumber-ruby/issues/1207) [@brasmusson](https://github.com/brasmusson)) * Handle the `--retry` option in profiles ([#1050](https://github.com/cucumber/cucumber-ruby/issues/1050) [@brasmusson](https://github.com/brasmusson)) +### Improved + +* Exclude the legacy_api from rubocop, regenerate Rubocop Todo ([@jaysonesmith](https://github.com/jaysonesmith), [@brasmusson](https://github.com/brasmusson)) +* Review and handle excluded/ignored cops ([#1208](https://github.com/cucumber/cucumber-ruby/pull/1208) [@jaysonesmith](https://github.com/jaysonesmith)) +* Fix SymbolProc issues ([#1212](https://github.com/cucumber/cucumber-ruby/pull/1212) [@jaysonesmith](https://github.com/jaysonesmith)) +* Fix TrailingBlankLines ([#1211](https://github.com/cucumber/cucumber-ruby/pull/1211) [@jaysonesmith](https://github.com/jaysonesmith)) + ## [3.0.1](https://github.com/cucumber/cucumber-ruby/compare/v3.0.0...3.0.1) (2017-09-29) ### Fixed From 9c4250d7d9af4e738ba8a6ef34ba45b0e1948503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aslak=20Helles=C3=B8y?= Date: Wed, 8 Nov 2017 09:16:56 +0000 Subject: [PATCH 22/29] Create stale.yml --- .github/stale.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/stale.yml diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 0000000000..246401fc40 --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,17 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 60 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 7 +# Issues with these labels will never be considered stale +exemptLabels: + - Slow Burner +# Label to use when marking an issue as stale +staleLabel: Stale +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed in a week if no further activity occurs. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: > + This issue has been automatically closed because of inactivity. + You can support the Cucumber core team on [opencollective](https://opencollective.com/cucumber). From e14a64ec5df69004750a9414ff9ebe4018c1e6ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Rasmusson?= Date: Sat, 11 Nov 2017 18:38:33 +0100 Subject: [PATCH 23/29] Attribution for #1216. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f944c02a1..3cfc98e5ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo ### Fixed +* Fix html reporter with more than one embedded screenshot ([#1216](https://github.com/cucumber/cucumber-ruby/pull/1216) [@nonkor](https://github.com/nonkor)) * Change test expectation to handle Ruby's unstable sorting ([#1210](https://github.com/cucumber/cucumber-ruby/pull/1210) [@jaysonesmith](https://github.com/jaysonesmith)) * Fix the printing of newlines in the rerun formatter - a problem introduced in [#1162](https://github.com/cucumber/cucumber-ruby/issues/1162) ([#1207](https://github.com/cucumber/cucumber-ruby/issues/1207) [@brasmusson](https://github.com/brasmusson)) * Handle the `--retry` option in profiles ([#1050](https://github.com/cucumber/cucumber-ruby/issues/1050) [@brasmusson](https://github.com/brasmusson)) From a53da67917b11afbf8a296b239937a785e958741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Rasmusson?= Date: Sat, 11 Nov 2017 19:12:11 +0100 Subject: [PATCH 24/29] Update bundler to '~> 1.16.0' to fix the JRuby CircleCI build --- Gemfile.lock | 4 ++-- cucumber.gemspec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 999b3cc940..54e05e5011 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -120,7 +120,7 @@ PLATFORMS DEPENDENCIES aruba (~> 0.6.1) bcat (~> 0.6.2) - bundler (~> 1.15.1) + bundler (~> 1.16.0) capybara (>= 2.1) cucumber! json (~> 1.8.6) @@ -138,4 +138,4 @@ DEPENDENCIES yard (~> 0.8.0) BUNDLED WITH - 1.15.4 + 1.16.0 diff --git a/cucumber.gemspec b/cucumber.gemspec index 9449d7e3ee..5281884d5b 100644 --- a/cucumber.gemspec +++ b/cucumber.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |s| s.add_dependency 'cucumber-wire', '~> 0.0.1' s.add_dependency 'cucumber-expressions', '~> 4.0.3' - s.add_development_dependency 'bundler', '~> 1.15.1' + s.add_development_dependency 'bundler', '~> 1.16.0' s.add_development_dependency 'aruba', '~> 0.6.1' s.add_development_dependency 'json', '~> 1.8.6' s.add_development_dependency 'nokogiri', '~> 1.8.1' From bebb002f2d948244231d8b8245763c84a2d2a91b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Rasmusson?= Date: Sat, 11 Nov 2017 19:35:56 +0100 Subject: [PATCH 25/29] Release 3.0.2 --- CHANGELOG.md | 16 +++++++++++++++- Gemfile.lock | 40 ++++++++++++++++++++-------------------- lib/cucumber/version | 2 +- 3 files changed, 36 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cfc98e5ae..ff0bb28c74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo ---- -## [In Git](https://github.com/cucumber/cucumber-ruby/compare/v3.0.1...master) (Not released) +## [In Git](https://github.com/cucumber/cucumber-ruby/compare/v3.0.2...master) (Not released) ### Added @@ -26,6 +26,20 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo ### Removed +* N/A + +### Fixed + +* N/A + +### Improved + +* N/A + +## [3.0.2](https://github.com/cucumber/cucumber-ruby/compare/v3.0.1...v3.0.2) (2017-11-11) + +### Removed + * Cucumber is no longer tested on Ruby 2.1 and below. ### Fixed diff --git a/Gemfile.lock b/Gemfile.lock index 54e05e5011..3e1b42ad59 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - cucumber (3.0.1) + cucumber (3.0.2) builder (>= 2.1.2) cucumber-core (~> 3.0.0) cucumber-expressions (~> 4.0.3) @@ -21,11 +21,11 @@ GEM cucumber (>= 1.1.1) rspec-expectations (>= 2.7.0) ast (2.3.0) - backports (3.8.0) + backports (3.10.3) bcat (0.6.2) rack (~> 1.0) builder (3.2.3) - capybara (2.15.1) + capybara (2.15.4) addressable mini_mime (>= 0.1.3) nokogiri (>= 1.3.3) @@ -39,7 +39,7 @@ GEM backports (>= 3.8.0) cucumber-tag_expressions (>= 1.0.1) gherkin (>= 4.1.3) - cucumber-expressions (4.0.3) + cucumber-expressions (4.0.4) cucumber-tag_expressions (1.0.1) cucumber-wire (0.0.1) diff-lcs (1.3) @@ -51,7 +51,7 @@ GEM json (1.8.6) kramdown (0.14.2) method_source (0.9.0) - mini_mime (0.1.4) + mini_mime (1.0.0) mini_portile2 (2.3.0) multi_json (1.12.2) multi_test (0.1.2) @@ -63,10 +63,10 @@ GEM parser (2.4.0.0) ast (~> 2.2) powerpack (0.1.1) - pry (0.11.1) + pry (0.11.2) coderay (~> 1.1.0) method_source (~> 0.9.0) - public_suffix (3.0.0) + public_suffix (3.0.1) rack (1.6.8) rack-protection (1.5.3) rack @@ -74,20 +74,20 @@ GEM rack (>= 1.0, < 3) rainbow (2.2.2) rake - rake (12.1.0) - rspec (3.6.0) - rspec-core (~> 3.6.0) - rspec-expectations (~> 3.6.0) - rspec-mocks (~> 3.6.0) - rspec-core (3.6.0) - rspec-support (~> 3.6.0) - rspec-expectations (3.6.0) + rake (12.2.1) + rspec (3.7.0) + rspec-core (~> 3.7.0) + rspec-expectations (~> 3.7.0) + rspec-mocks (~> 3.7.0) + rspec-core (3.7.0) + rspec-support (~> 3.7.0) + rspec-expectations (3.7.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.6.0) - rspec-mocks (3.6.0) + rspec-support (~> 3.7.0) + rspec-mocks (3.7.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.6.0) - rspec-support (3.6.0) + rspec-support (~> 3.7.0) + rspec-support (3.7.0) rubocop (0.40.0) parser (>= 2.3.1.0, < 3.0) powerpack (~> 0.1) @@ -98,7 +98,7 @@ GEM sawyer (0.8.1) addressable (>= 2.3.5, < 2.6) faraday (~> 0.8, < 1.0) - simplecov (0.14.1) + simplecov (0.15.1) docile (~> 1.1.0) json (>= 1.8, < 3) simplecov-html (~> 0.10.0) diff --git a/lib/cucumber/version b/lib/cucumber/version index cb2b00e4f7..b502146930 100644 --- a/lib/cucumber/version +++ b/lib/cucumber/version @@ -1 +1 @@ -3.0.1 +3.0.2 From 3ce5aee2e7b54d00818e6a71668cf67bf745c7c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Rasmusson?= Date: Sun, 19 Nov 2017 11:36:44 +0100 Subject: [PATCH 26/29] Add #to_s to the hook classes to be used by the junit formatter --- lib/cucumber/hooks.rb | 12 ++++++ spec/cucumber/formatter/junit_spec.rb | 56 +++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/lib/cucumber/hooks.rb b/lib/cucumber/hooks.rb index f457866f42..d3a5d98f93 100644 --- a/lib/cucumber/hooks.rb +++ b/lib/cucumber/hooks.rb @@ -47,6 +47,10 @@ def text 'After hook' end + def to_s + "#{text} at #{location}" + end + def match_locations?(queried_locations) queried_locations.any? { |other_location| other_location.match?(location) } end @@ -67,6 +71,10 @@ def text 'Before hook' end + def to_s + "#{text} at #{location}" + end + def match_locations?(queried_locations) queried_locations.any? { |other_location| other_location.match?(location) } end @@ -87,6 +95,10 @@ def text 'AfterStep hook' end + def to_s + "#{text} at #{location}" + end + def match_locations?(queried_locations) queried_locations.any? { |other_location| other_location.match?(location) } end diff --git a/spec/cucumber/formatter/junit_spec.rb b/spec/cucumber/formatter/junit_spec.rb index 6d37330736..9977c8f3ab 100644 --- a/spec/cucumber/formatter/junit_spec.rb +++ b/spec/cucumber/formatter/junit_spec.rb @@ -192,6 +192,62 @@ def after_step(step) it { expect(@doc.to_s).not_to match(/milk/) } it { expect(@doc.to_s).not_to match(/cookies/) } end + + context 'with failing hooks' do + describe 'with a failing before hook' do + define_steps do + Before do + raise 'Before hook failed' + end + Given(/a passing step/) do + end + end + define_feature <<-FEATURE + Feature: One passing scenario + + Scenario: Passing + Given a passing step + FEATURE + + it { expect(@doc.to_s).to match(%r{Before hook at spec/cucumber/formatter/junit_spec.rb:(\d+)}) } + end + + describe 'with a failing after hook' do + define_steps do + After do + raise 'After hook failed' + end + Given(/a passing step/) do + end + end + define_feature <<-FEATURE + Feature: One passing scenario + + Scenario: Passing + Given a passing step + FEATURE + + it { expect(@doc.to_s).to match(%r{After hook at spec/cucumber/formatter/junit_spec.rb:(\d+)}) } + end + + describe 'with a failing after step hook' do + define_steps do + AfterStep do + raise 'AfterStep hook failed' + end + Given(/a passing step/) do + end + end + define_feature <<-FEATURE + Feature: One passing scenario + + Scenario: Passing + Given a passing step + FEATURE + + it { expect(@doc.to_s).to match(%r{AfterStep hook at spec/cucumber/formatter/junit_spec.rb:(\d+)}) } + end + end end end From 9605e88c787473dac7615aa0e3725bf6f3dfd82a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Rasmusson?= Date: Sun, 19 Nov 2017 12:24:56 +0100 Subject: [PATCH 27/29] Fix the handling of failing around hooks in the JUnit Formatter. Supersedes and closes #1233. --- CHANGELOG.md | 2 +- lib/cucumber/formatter/junit.rb | 8 ++++++-- spec/cucumber/formatter/junit_spec.rb | 19 +++++++++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff0bb28c74..c087baa7b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,7 +30,7 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo ### Fixed -* N/A +* Fix the handling of failed hooks in the JUnit Formatter ([@brasmusson](https://github.com/brasmusson)) ### Improved diff --git a/lib/cucumber/formatter/junit.rb b/lib/cucumber/formatter/junit.rb index 9ce6cad9a7..24f30d163a 100644 --- a/lib/cucumber/formatter/junit.rb +++ b/lib/cucumber/formatter/junit.rb @@ -104,8 +104,12 @@ def create_output_string(test_case, scenario, result, row_name) output = "#{test_case.keyword}: #{scenario}\n\n" return output if result.ok?(@config.strict) if test_case.keyword == 'Scenario' - output += @failing_step_source.keyword.to_s unless hook?(@failing_step_source) - output += "#{@failing_step_source}\n" + if @failing_step_source + output += @failing_step_source.keyword.to_s unless hook?(@failing_step_source) + output += "#{@failing_step_source}\n" + else # An Around hook has failed + output += "Around hook\n" + end else output += "Example row: #{row_name}\n" end diff --git a/spec/cucumber/formatter/junit_spec.rb b/spec/cucumber/formatter/junit_spec.rb index 9977c8f3ab..ff6b15338e 100644 --- a/spec/cucumber/formatter/junit_spec.rb +++ b/spec/cucumber/formatter/junit_spec.rb @@ -247,6 +247,25 @@ def after_step(step) it { expect(@doc.to_s).to match(%r{AfterStep hook at spec/cucumber/formatter/junit_spec.rb:(\d+)}) } end + + describe 'with a failing around hook' do + define_steps do + Around do |_scenario, block| + block.call + raise 'Around hook failed' + end + Given(/a passing step/) do + end + end + define_feature <<-FEATURE + Feature: One passing scenario + + Scenario: Passing + Given a passing step + FEATURE + + it { expect(@doc.to_s).to match(/Around hook\n\nMessage:/) } + end end end end From 4dba15f70b06c03a0b84dfbe37cae1fc8ba1b08a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aslak=20Helles=C3=B8y?= Date: Fri, 24 Nov 2017 09:22:57 +0000 Subject: [PATCH 28/29] Update rubocop --- Gemfile.lock | 12 +++++++----- cucumber.gemspec | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3e1b42ad59..7299c5471a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -60,8 +60,9 @@ GEM mini_portile2 (~> 2.3.0) octokit (4.7.0) sawyer (~> 0.8.0, >= 0.5.3) - parser (2.4.0.0) - ast (~> 2.2) + parallel (1.12.0) + parser (2.4.0.2) + ast (~> 2.3) powerpack (0.1.1) pry (0.11.2) coderay (~> 1.1.0) @@ -88,8 +89,9 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.7.0) rspec-support (3.7.0) - rubocop (0.40.0) - parser (>= 2.3.1.0, < 3.0) + rubocop (0.49.1) + parallel (~> 1.10) + parser (>= 2.3.3.1, < 3.0) powerpack (~> 0.1) rainbow (>= 1.99.1, < 3.0) ruby-progressbar (~> 1.7) @@ -131,7 +133,7 @@ DEPENDENCIES rack-test (>= 0.6.1) rake (>= 0.9.2) rspec (>= 3.6) - rubocop (~> 0.40.0) + rubocop (~> 0.49.0) simplecov (>= 0.6.2) sinatra (>= 1.3.2) syntax (>= 1.0.0) diff --git a/cucumber.gemspec b/cucumber.gemspec index 5281884d5b..5ee785017b 100644 --- a/cucumber.gemspec +++ b/cucumber.gemspec @@ -28,7 +28,7 @@ Gem::Specification.new do |s| s.add_development_dependency 'simplecov', '>= 0.6.2' s.add_development_dependency 'syntax', '>= 1.0.0' s.add_development_dependency 'pry' - s.add_development_dependency 'rubocop', '~> 0.40.0' + s.add_development_dependency 'rubocop', '~> 0.49.0' # For maintainer scripts s.add_development_dependency 'octokit' From 201cc8c6324ffbe245e380886ba59be8ea3d7bf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aslak=20Helles=C3=B8y?= Date: Fri, 24 Nov 2017 09:27:21 +0000 Subject: [PATCH 29/29] Don't suggest {list} in snippets (too generic regexp) --- features/bugs/1238.feature | 3 +++ features/lib/support/parameter_types.rb | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 features/bugs/1238.feature diff --git a/features/bugs/1238.feature b/features/bugs/1238.feature new file mode 100644 index 0000000000..8e95124cda --- /dev/null +++ b/features/bugs/1238.feature @@ -0,0 +1,3 @@ +Feature: 1238 + Scenario: Test scenario + Given Alpha1 \ No newline at end of file diff --git a/features/lib/support/parameter_types.rb b/features/lib/support/parameter_types.rb index 752cc68a55..adc3e1a3b1 100644 --- a/features/lib/support/parameter_types.rb +++ b/features/lib/support/parameter_types.rb @@ -1,5 +1,6 @@ ParameterType( name: 'list', regexp: /.*/, - transformer: ->(s) { s.split(/,\s+/)} + transformer: -> (s) { s.split(/,\s+/)}, + use_for_snippets: false )