diff --git a/.circleci/config.yml b/.circleci/config.yml index 5abeea9603..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 @@ -23,11 +29,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 +50,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 +71,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,17 +92,16 @@ 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 build: jobs: + # Keep lowest ruby-* version in sync with .cucumber.gemspec - "ruby-2.4.1" - "ruby-2.3.5" - "ruby-2.2.8" - "jruby-9.1.13.0" + - publish 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 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). diff --git a/.rubocop.yml b/.rubocop.yml index a108ae0b58..313c27a187 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -11,3 +11,30 @@ AllCops: DisplayStyleGuide: true 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: + 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 a00912c7d5..96ec39ab85 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,30 +1,20 @@ # 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 # 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: - '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 @@ -38,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 @@ -57,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 @@ -125,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. @@ -135,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 @@ -146,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 @@ -188,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 @@ -205,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 @@ -220,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' @@ -239,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' @@ -254,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. @@ -268,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 @@ -290,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: @@ -361,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: @@ -370,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. @@ -397,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 @@ -422,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: @@ -432,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 @@ -463,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 @@ -485,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 @@ -517,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: @@ -529,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 @@ -557,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 @@ -565,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' @@ -578,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 @@ -603,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' @@ -618,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 @@ -628,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. @@ -647,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: @@ -691,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' @@ -717,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: @@ -744,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 @@ -762,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. @@ -782,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. @@ -800,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: @@ -857,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 @@ -883,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: @@ -901,91 +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' - -# Offense count: 35 -# Cop supports --auto-correct. -# Configuration parameters: IgnoredMethods. -# IgnoredMethods: respond_to, define_method -Style/SymbolProc: - 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' - -# 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) -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 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/CHANGELOG.md b/CHANGELOG.md index ee20611bc3..c087baa7b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,24 +10,51 @@ 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 + +* N/A ### Changed * N/A -### Added +### Deprecated + +* N/A + +### Removed * N/A ### Fixed +* Fix the handling of failed hooks in the JUnit Formatter ([@brasmusson](https://github.com/brasmusson)) + +### 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 + +* 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)) ### Improved -* N/A +* 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) diff --git a/Gemfile.lock b/Gemfile.lock index e15749999d..3ccc1d3c1d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,10 +1,10 @@ PATH remote: . specs: - cucumber (3.0.1) + cucumber (3.0.2) builder (>= 2.1.2) cucumber-core (~> 3.0.0) - cucumber-expressions (~> 5.0.0) + cucumber-expressions (~> 5.0.3) cucumber-wire (~> 0.0.1) diff-lcs (~> 1.3) gherkin (~> 4.0) @@ -21,11 +21,11 @@ GEM cucumber (>= 1.1.1) rspec-expectations (>= 2.7.0) ast (2.3.0) - backports (3.9.1) + backports (3.10.3) bcat (0.6.2) rack (~> 1.0) builder (3.2.3) - capybara (2.15.1) + capybara (2.16.1) addressable mini_mime (>= 0.1.3) nokogiri (>= 1.3.3) @@ -35,17 +35,11 @@ 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) gherkin (>= 4.1.3) - cucumber-expressions (5.0.0) + cucumber-expressions (5.0.3) cucumber-tag_expressions (1.0.1) cucumber-wire (0.0.1) diff-lcs (1.3) @@ -57,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) @@ -66,36 +60,38 @@ 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.1) + pry (0.11.3) 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 - rack-test (0.7.0) + rack-test (0.8.2) 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.3.0) + 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) - rubocop (0.40.0) - parser (>= 2.3.1.0, < 3.0) + rspec-support (~> 3.7.0) + rspec-support (3.7.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) @@ -104,7 +100,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) @@ -114,11 +110,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 +122,8 @@ PLATFORMS DEPENDENCIES aruba (~> 0.6.1) bcat (~> 0.6.2) - bundler (~> 1.15.4) + bundler (~> 1.16.0) capybara (>= 2.1) - coveralls (~> 0.7) cucumber! json (~> 1.8.6) kramdown (~> 0.14) @@ -142,11 +133,11 @@ 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) yard (~> 0.8.0) BUNDLED WITH - 1.15.4 + 1.16.0 diff --git a/README.md b/README.md index 555a1b19ef..74d8d6b886 100644 --- a/README.md +++ b/README.md @@ -2,8 +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) [![Coverage Status](https://coveralls.io/repos/cucumber/cucumber-ruby/badge.svg?branch=master)](https://coveralls.io/r/cucumber/cucumber-ruby?branch=master) @@ -40,4 +38,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. diff --git a/Rakefile b/Rakefile index 15257970ec..f1a11a543a 100644 --- a/Rakefile +++ b/Rakefile @@ -14,17 +14,7 @@ Cucumber::Rake::Task.new do |t| t.profile = 'ruby' if Cucumber::RUBY 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 +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= - diff --git a/cucumber.gemspec b/cucumber.gemspec index 81e64cf96f..8f492beae2 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' @@ -17,19 +17,18 @@ Gem::Specification.new do |s| s.add_dependency 'multi_json', '>= 1.7.5', '< 2.0' s.add_dependency 'multi_test', '>= 0.1.2' s.add_dependency 'cucumber-wire', '~> 0.0.1' - s.add_dependency 'cucumber-expressions', '~> 5.0.0' + s.add_dependency 'cucumber-expressions', '~> 5.0.3' - s.add_development_dependency 'bundler', '~> 1.15.4' + 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' 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' + s.add_development_dependency 'rubocop', '~> 0.49.0' # For maintainer scripts s.add_development_dependency 'octokit' 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/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/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/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/features/docs/README.md b/features/docs/README.md new file mode 100644 index 0000000000..ba332ae971 --- /dev/null +++ b/features/docs/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. 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: """ 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 ) 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/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.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/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.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/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/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/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/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/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/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/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_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/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 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 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/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 diff --git a/spec/cucumber/formatter/junit_spec.rb b/spec/cucumber/formatter/junit_spec.rb index 6d37330736..ff6b15338e 100644 --- a/spec/cucumber/formatter/junit_spec.rb +++ b/spec/cucumber/formatter/junit_spec.rb @@ -192,6 +192,81 @@ 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 + + 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 diff --git a/spec/cucumber/formatter/pretty_spec.rb b/spec/cucumber/formatter/pretty_spec.rb index a4af7f6e89..b8d15595e1 100644 --- a/spec/cucumber/formatter/pretty_spec.rb +++ b/spec/cucumber/formatter/pretty_spec.rb @@ -374,7 +374,6 @@ module Formatter | dummy | FEATURE - it 'includes the tags in the output ' do expect( @out.string ).to include < '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 diff --git a/spec/support/standard_step_actions.rb b/spec/support/standard_step_actions.rb index 3627441061..7bed6fd191 100644 --- a/spec/support/standard_step_actions.rb +++ b/spec/support/standard_step_actions.rb @@ -16,4 +16,3 @@ def test_case(test_case) test_case.with_steps(test_steps).describe_to(receiver) end end -