Skip to content

Commit

Permalink
Merge master and fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
mxygem committed Jan 7, 2018
2 parents 31053e9 + 6ca6b7e commit 0d0f0ed
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 54 deletions.
7 changes: 6 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ AllCops:

# 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
Enabled: false

# Rubocop doesn't like method names in other languages but as Cucumber supports
# languages, this cop needs to be disabled.
Style/AsciiIdentifiers:
Enabled: false

# Reviewed: in pretty_spec.rb, progress_spec.rb offences look false,
# as the trailing spaces are in multiline string literals
Expand Down
37 changes: 4 additions & 33 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ Lint/Eval:
- 'lib/cucumber/formatter/ansicolor.rb'
- 'lib/cucumber/term/ansicolor.rb'

# Offense count: 1
Lint/HandleExceptions:
Exclude:
- 'lib/cucumber/rake/task.rb'

# Offense count: 2
Lint/IneffectiveAccessModifier:
Exclude:
Expand Down Expand Up @@ -98,7 +93,7 @@ Performance/RedundantMatch:
- 'lib/cucumber/deprecate.rb'
- 'spec/cucumber/formatter/junit_spec.rb'

# Offense count: 6
# Offense count: 7
Style/AccessorMethodName:
Exclude:
- 'lib/autotest/cucumber_mixin.rb'
Expand All @@ -113,31 +108,6 @@ Style/Alias:
Exclude:
- 'lib/cucumber/formatter/ansicolor.rb'

# Offense count: 19
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: with_first_parameter, with_fixed_indentation
Style/AlignParameters:
Exclude:
- 'features/lib/step_definitions/cucumber_steps.rb'
- 'features/lib/step_definitions/retry_steps.rb'
- 'lib/cucumber/cli/options.rb'
- 'lib/cucumber/runtime/for_programming_languages.rb'

# Offense count: 73
Style/AsciiIdentifiers:
Exclude:
- 'examples/i18n/ar/lib/calculator.rb'
- 'examples/i18n/bg/features/step_definitions/calculator_steps.rb'
- 'examples/i18n/el/features/step_definitions/calculator_steps.rb'
- 'examples/i18n/he/lib/calculator.rb'
- 'examples/i18n/ja/features/step_definitions/calculator_steps.rb'
- 'examples/i18n/ru/features/step_definitions/calculator_steps.rb'
- 'examples/i18n/sr-Cyrl/features/step_definitions/calculator_steps.rb'
- 'examples/i18n/tr/lib/hesap_makinesi.rb'
- 'examples/i18n/uk/features/step_definitions/calculator_steps.rb'
- 'examples/i18n/uz/features/step_definitions/calculator_steps.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/Attr:
Expand Down Expand Up @@ -500,7 +470,7 @@ Style/MultilineMethodCallBraceLayout:
- 'spec/cucumber/formatter/spec_helper.rb'
- 'spec/cucumber/rake/forked_spec.rb'

# Offense count: 2
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
# SupportedStyles: aligned, indented
Expand Down Expand Up @@ -695,7 +665,7 @@ Style/RescueModifier:
- 'gem_tasks/contributors.rake'
- 'lib/cucumber/multiline_argument/data_table.rb'

# Offense count: 3
# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: AllowAsExpressionSeparator.
Style/Semicolon:
Expand Down Expand Up @@ -790,6 +760,7 @@ Style/SpaceBeforeComma:
- 'lib/cucumber/term/ansicolor.rb'

# Offense count: 208

# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
# SupportedStyles: space, no_space
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo
* N/A

### Improved

* Fix Performance/RedundantBlockCall ([#1220](https://github.com/cucumber/cucumber-ruby/pull/1220) [@jaysonesmith](https://github.com/jaysonesmith))
* Fix Style/AlignParameters ([#1221](https://github.com/cucumber/cucumber-ruby/pull/1221) [@jaysonesmith](https://github.com/jaysonesmith))
* Fix Style/AsciiComments ([#1222](https://github.com/cucumber/cucumber-ruby/pull/1222) [@jaysonesmith](https://github.com/jaysonesmith))
* Exclude Style/AsciiIdentifiers ([#1223](https://github.com/cucumber/cucumber-ruby/pull/1223) [@jaysonesmith](https://github.com/jaysonesmith))
* Fix Lint/HandleExceptions ([#1226](https://github.com/cucumber/cucumber-ruby/pull/1226) [@jaysonesmith](https://github.com/jaysonesmith))

## [3.1.0](https://github.com/cucumber/cucumber-ruby/compare/v3.0.2...3.1.0) (2017-11-28)

Expand Down
11 changes: 5 additions & 6 deletions features/lib/step_definitions/cucumber_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@

Given('the standard step definitions') do
write_file 'features/step_definitions/steps.rb',

<<-STEPS
<<-STEPS
Given(/^this step passes$/) { }
Given(/^this step raises an error$/) { raise 'error' }
Given(/^this step is pending$/) { pending }
Expand All @@ -35,28 +34,28 @@

Given('a scenario {string} that passes') do |name|
write_file "features/#{name}.feature",
<<-FEATURE
<<-FEATURE
Feature: #{name}
Scenario: #{name}
Given it passes
FEATURE

write_file "features/step_definitions/#{name}_steps.rb",
<<-STEPS
<<-STEPS
Given(/^it passes$/) { expect(true).to be true }
STEPS
end

Given('a scenario {string} that fails') do |name|
write_file "features/#{name}.feature",
<<-FEATURE
<<-FEATURE
Feature: #{name}
Scenario: #{name}
Given it fails
FEATURE

write_file "features/step_definitions/#{name}_steps.rb",
<<-STEPS
<<-STEPS
Given(/^it fails$/) { expect(false).to be true }
STEPS
end
Expand Down
12 changes: 6 additions & 6 deletions features/lib/step_definitions/retry_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,37 @@
Given('a scenario {string} that fails once, then passes') do |full_name|
name = snake_case(full_name)
write_file "features/#{name}.feature",
<<-FEATURE
<<-FEATURE
Feature: #{full_name} feature
Scenario: #{full_name}
Given it fails once, then passes
FEATURE

write_file "features/step_definitions/#{name}_steps.rb",
<<-STEPS
<<-STEPS
Given(/^it fails once, then passes$/) do
$#{name} += 1
expect($#{name}).to be > 1
end
STEPS

write_file "features/support/#{name}_init.rb",
<<-INIT
<<-INIT
$#{name} = 0
INIT
end

Given('a scenario {string} that fails twice, then passes') do |full_name|
name = snake_case(full_name)
write_file "features/#{name}.feature",
<<-FEATURE
<<-FEATURE
Feature: #{full_name} feature
Scenario: #{full_name}
Given it fails twice, then passes
FEATURE

write_file "features/step_definitions/#{name}_steps.rb",
<<-STEPS
<<-STEPS
Given(/^it fails twice, then passes$/) do
$#{name} ||= 0
$#{name} += 1
Expand All @@ -41,7 +41,7 @@
STEPS

write_file "features/support/#{name}_init.rb",
<<-INIT
<<-INIT
$#{name} = 0
INIT
end
Expand Down
2 changes: 1 addition & 1 deletion lib/cucumber/cli/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def parse!(args) # rubocop:disable Metrics/AbcSize
opts.on('-x', '--expand', 'Expand Scenario Outline Tables in output.') { set_option :expand }

opts.on('--order TYPE[:SEED]', 'Run examples in the specified order. Available types:',
*<<-TEXT.split("\n")) do |order|
*<<-TEXT.split("\n")) do |order|
[defined] Run scenarios in the order they were defined (default).
[random] Shuffle scenarios before running.
Specify SEED to reproduce the shuffling from a previous run.
Expand Down
2 changes: 2 additions & 0 deletions lib/cucumber/rake/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
begin
# Support Rake > 0.8.7
require 'rake/dsl_definition'
# rubocop:disable Lint/HandleExceptions
rescue LoadError
# rubocop:enable Lint/HandleExceptions
end

module Cucumber
Expand Down
14 changes: 7 additions & 7 deletions lib/cucumber/runtime/for_programming_languages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ def initialize(support_code, user_interface)
end

def_delegators :@user_interface,
:embed,
:ask,
:puts,
:features_paths,
:step_match
:embed,
:ask,
:puts,
:features_paths,
:step_match

def_delegators :@support_code,
:invoke_dynamic_steps,
:invoke_dynamic_step
:invoke_dynamic_steps,
:invoke_dynamic_step
end
end
end

0 comments on commit 0d0f0ed

Please sign in to comment.