Skip to content

Commit

Permalink
Merge #1309 'Adapt to using the Gherkin compiler and Pickles in the c…
Browse files Browse the repository at this point in the history
…ore'

Also update Changelog.md and Gemfile.
  • Loading branch information
brasmusson committed Jul 26, 2018
2 parents 3c23261 + 486e4fe commit 7f43c95
Show file tree
Hide file tree
Showing 64 changed files with 536 additions and 679 deletions.
12 changes: 9 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Naming/MethodName:


# By FAR the most used form of regex values in the project are with slashes.
# Rubocop doesn't handle all cases well (currently), so this cop has been
# Rubocop doesn't handle all cases well (currently), so this cop has been
# disabled in some cases.
Style/RegexpLiteral:
EnforcedStyle: slashes
Expand Down Expand Up @@ -80,7 +80,7 @@ Metrics/ClassLength:
Exclude:
- 'lib/cucumber/cli/options.rb'

# Rubocop doesn't like method names in other languages but as Cucumber supports
# Rubocop doesn't like method names in other languages but as Cucumber supports
# languages, this cop needs to be disabled.
Naming/AsciiIdentifiers:
Enabled: false
Expand All @@ -93,4 +93,10 @@ Naming/VariableName:
- 'examples/i18n/uz/features/step_definitions/calculator_steps.rb'

Style/ClassAndModuleChildren:
Enabled: false
Enabled: false

# Reviewed: we need to specify 'cucumber-core' and 'cucumber-wire' twice
# to be able to build using git on CI, but also using local repos locally.
Bundler/DuplicatedGem:
Exclude:
- 'Gemfile'
1 change: 0 additions & 1 deletion .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ Style/GuardClause:
- 'lib/cucumber/glue/invoke_in_world.rb'
- 'lib/cucumber/glue/proto_world.rb'
- 'lib/cucumber/rspec/disable_option_parser.rb'
- 'lib/cucumber/step_argument.rb'
- 'lib/cucumber/term/ansicolor.rb'

# Offense count: 2
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo

### Changed

* Pass the registry to the Wire plugin.
([#1309](https://github.com/cucumber/cucumber-ruby/pull/1309)
[brasmusson](https://github.com/brasmusson))
* Adapt to using the Gherkin compiler and Pickles in the core.
([#1309](https://github.com/cucumber/cucumber-ruby/pull/1309)
[brasmusson](https://github.com/brasmusson))
* Let the Pretty Formatter use events.
([#1305](https://github.com/cucumber/cucumber-ruby/pull/1305)
[brasmusson](https://github.com/brasmusson))
Expand Down
12 changes: 10 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
source 'https://rubygems.org'
gemspec

gem 'cucumber-core', path: ENV['CUCUMBER_RUBY_CORE'] if ENV['CUCUMBER_RUBY_CORE']
if ENV['CUCUMBER_RUBY_CORE']
gem 'cucumber-core', path: ENV['CUCUMBER_RUBY_CORE']
elsif !ENV['CUCUMBER_USE_RELEASED_GEMS']
gem 'cucumber-core', git: 'git://github.com/cucumber/cucumber-ruby-core.git'
end

gem 'cucumber-wire', path: ENV['CUCUMBER_RUBY_WIRE'] if ENV['CUCUMBER_RUBY_WIRE']
if ENV['CUCUMBER_RUBY_WIRE']
gem 'cucumber-wire', path: ENV['CUCUMBER_RUBY_WIRE']
elsif !ENV['CUCUMBER_USE_RELEASED_GEMS']
gem 'cucumber-wire', git: 'git://github.com/cucumber/cucumber-ruby-wire.git'
end

gem 'cucumber-expressions', path: ENV['CUCUMBER_EXPRESSIONS_RUBY'] if ENV['CUCUMBER_EXPRESSIONS_RUBY']
2 changes: 1 addition & 1 deletion features/docs/cli/dry_run.feature
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Feature: Dry Run
Scenario: # features/test.feature:2
Given this step is undefined # features/test.feature:3
Undefined step: "this step is undefined" (Cucumber::Core::Test::Result::Undefined)
features/test.feature:3:in `Given this step is undefined'
features/test.feature:3:in `this step is undefined'
Undefined Scenarios:
cucumber features/test.feature:2 # Scenario:
Expand Down
8 changes: 4 additions & 4 deletions features/docs/cli/randomize.feature
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Feature: Randomize
When I depend on the state
I expect the state to be set! (RuntimeError)
./features/step_definitions/steps.rb:6:in `/^I depend on the state$/'
features/bad_practice_part_1.feature:7:in `When I depend on the state'
features/bad_practice_part_1.feature:7:in `I depend on the state'
Feature: Unrelated
Expand All @@ -83,7 +83,7 @@ Feature: Randomize
When I depend on the state
I expect the state to be set! (RuntimeError)
./features/step_definitions/steps.rb:6:in `/^I depend on the state$/'
features/bad_practice_part_2.feature:4:in `When I depend on the state'
features/bad_practice_part_2.feature:4:in `I depend on the state'
Feature: Bad practice, part 1
Expand Down Expand Up @@ -113,15 +113,15 @@ Feature: Randomize
When I depend on the state
I expect the state to be set! (RuntimeError)
./features/step_definitions/steps.rb:6:in `/^I depend on the state$/'
features/bad_practice_part_1.feature:7:in `When I depend on the state'
features/bad_practice_part_1.feature:7:in `I depend on the state'
Feature: Bad practice, part 2
Scenario: Depend on state from a preceding feature
When I depend on the state
I expect the state to be set! (RuntimeError)
./features/step_definitions/steps.rb:6:in `/^I depend on the state$/'
features/bad_practice_part_2.feature:4:in `When I depend on the state'
features/bad_practice_part_2.feature:4:in `I depend on the state'
Feature: Bad practice, part 1
Expand Down
34 changes: 0 additions & 34 deletions features/docs/cli/run_scenarios_matching_name.feature
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,6 @@ Feature: Run feature elements matching a name with --name/-n
| b |
"""

@todo-windows
Scenario: Matching Feature names
When I run `cucumber -q --name feature`
Then it should pass with:
"""
Feature: first feature
Scenario: foo first
Given missing
Scenario: bar first
Given missing
2 scenarios (2 undefined)
2 steps (2 undefined)
"""

Scenario: Matching Scenario names
When I run `cucumber -q --name foo`
Then it should pass with:
Expand Down Expand Up @@ -86,20 +69,3 @@ Feature: Run feature elements matching a name with --name/-n
2 steps (2 undefined)
"""

Scenario: Matching Example block names
When I run `cucumber -q --name quux`
Then it should pass with:
"""
Feature: outline
Scenario Outline: baz outline
Given outline step <name>
Examples: quux example
| name |
| a |
| b |
2 scenarios (2 undefined)
2 steps (2 undefined)
"""
4 changes: 2 additions & 2 deletions features/docs/cli/run_specific_scenarios.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Feature: Run specific scenarios
Scenario: Hit
Given this step passes
"""
When I run `cucumber features/test.feature:7 --format pretty --quiet`
When I run `cucumber features/test.feature:6 --format pretty --quiet`
Then it should pass with exactly:
"""
Feature:
Expand Down Expand Up @@ -69,7 +69,7 @@ Feature: Run specific scenarios
Scenario:
Given this step fails
"""
When I run `cucumber features/test.feature:5 features/test.feature:3 -f progress`
When I run `cucumber features/test.feature:5 features/test.feature:2 -f progress`
Then it should fail with:
"""
F.
Expand Down
2 changes: 1 addition & 1 deletion features/docs/cli/showing_differences.feature
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Feature: Showing differences to expected output
(compared using ==)
(RSpec::Expectations::ExpectationNotMetError)
./features/step_definitions/steps.rb:2:in `/^failing expectation$/'
features/failing_expectation.feature:4:in `Given failing expectation'
features/failing_expectation.feature:4:in `failing expectation'
Failing Scenarios:
cucumber features/failing_expectation.feature:3
Expand Down
4 changes: 2 additions & 2 deletions features/docs/cli/strict_mode.feature
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Feature: Strict mode
Scenario: Missing
Given this step passes
Undefined step: "this step passes" (Cucumber::Core::Test::Result::Undefined)
features/missing.feature:3:in `Given this step passes'
features/missing.feature:3:in `this step passes'
Undefined Scenarios:
cucumber features/missing.feature:2
Expand All @@ -46,7 +46,7 @@ Feature: Strict mode
Given this step is pending
TODO (Cucumber::Pending)
./features/step_definitions/steps.rb:3:in `/^this step is pending$/'
features/pending.feature:3:in `Given this step is pending'
features/pending.feature:3:in `this step is pending'
Pending Scenarios:
cucumber features/pending.feature:2
Expand Down
2 changes: 1 addition & 1 deletion features/docs/defining_steps/ambiguous_steps.feature
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Feature: Ambiguous Steps
You can run again with --guess to make Cucumber be more smart about it
(Cucumber::Ambiguous)
features/ambiguous.feature:5:in `Then an ambiguous step'
features/ambiguous.feature:5:in `an ambiguous step'
Failing Scenarios:
cucumber features/ambiguous.feature:3 # Scenario:
Expand Down
6 changes: 3 additions & 3 deletions features/docs/defining_steps/nested_steps.feature
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Feature: Nested Steps
error (RuntimeError)
./features/step_definitions/steps2.rb:5:in `/I have a couple turtles/'
./features/step_definitions/steps2.rb:2:in `/two turtles/'
features/test_feature_1.feature:3:in `Given two turtles'
features/test_feature_1.feature:3:in `two turtles'
Failing Scenarios:
cucumber features/test_feature_1.feature:2 # Scenario: Test Scenario 1
Expand Down Expand Up @@ -162,14 +162,14 @@ Feature: Nested Steps
Given a step that calls an undefined step
Undefined dynamic step: "this does not exist" (Cucumber::UndefinedDynamicStep)
./features/step_definitions/steps.rb:2:in `/^a step that calls an undefined step$/'
features/call_undefined_step_from_step_def.feature:4:in `Given a step that calls an undefined step'
features/call_undefined_step_from_step_def.feature:4:in `a step that calls an undefined step'
Scenario: Call via another
Given a step that calls a step that calls an undefined step
Undefined dynamic step: "this does not exist" (Cucumber::UndefinedDynamicStep)
./features/step_definitions/steps.rb:2:in `/^a step that calls an undefined step$/'
./features/step_definitions/steps.rb:6:in `/^a step that calls a step that calls an undefined step$/'
features/call_undefined_step_from_step_def.feature:7:in `Given a step that calls a step that calls an undefined step'
features/call_undefined_step_from_step_def.feature:7:in `a step that calls a step that calls an undefined step'
Failing Scenarios:
cucumber features/call_undefined_step_from_step_def.feature:3
Expand Down
5 changes: 2 additions & 3 deletions features/docs/defining_steps/printing_messages.feature
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Feature: Pretty formatter - Printing messages
Announce with fail
(RuntimeError)
./features/step_definitions/puts_steps.rb:18:in `/^I use puts and step fails$/'
features/f.feature:21:in `Given I use puts and step fails'
features/f.feature:21:in `I use puts and step fails'
And this step passes
Scenario Outline:
Expand All @@ -121,8 +121,7 @@ Feature: Pretty formatter - Printing messages
| 1 | anno1 | fail | Line: 1: anno1
(RuntimeError)
./features/step_definitions/puts_steps.rb:13:in `/^I use message (.+) in line (.+) (?:with result (.+))$/'
features/f.feature:29:in `Given I use message anno1 in line 1 with result fail'
features/f.feature:25:in `Given I use message <ann> in line <line> with result <result>'
features/f.feature:29:25:in `I use message anno1 in line 1 with result fail'
| 2 | anno2 | pass | Line: 2: anno2
"""

Expand Down
2 changes: 1 addition & 1 deletion features/docs/defining_steps/table_diffing.feature
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Feature: Table diffing
| (+) a | (+) c |
(Cucumber::MultilineArgument::DataTable::Different)
./features/step_definitions/steps.rb:2:in `/the table should be:/'
features/tables.feature:3:in `Then the table should be:'
features/tables.feature:3:in `the table should be:'
Failing Scenarios:
cucumber features/tables.feature:2 # Scenario: Extra row
Expand Down
2 changes: 1 addition & 1 deletion features/docs/exception_in_after_step_hook.feature
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Feature: Exception in AfterStep Block
Given this step passes # features/step_definitions/steps.rb:1
Failing Scenarios:
cucumber features/naughty_step_in_scenario_outline.feature:9 # Scenario Outline: Naughty Step, Examples (#2)
cucumber features/naughty_step_in_scenario_outline.feature:9 # Scenario Outline: Naughty Step
4 scenarios (1 failed, 3 passed)
4 steps (4 passed)
Expand Down
6 changes: 1 addition & 5 deletions features/docs/extending_cucumber/custom_formatter.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,14 @@ Feature: Custom Formatter
end
def print_test_case_name(test_case)
feature = test_case.source.first
scenario = test_case.source.last
@io.puts feature.short_name.upcase
@io.puts " #{scenario.name.upcase}"
@io.puts " #{test_case.name.upcase}"
end
end
end
"""
When I run `cucumber features/f.feature --format MyCustom::Formatter`
Then it should pass with exactly:
"""
I'LL USE MY OWN
JUST PRINT ME
"""
Expand Down
8 changes: 4 additions & 4 deletions features/docs/formatters/json_formatter.feature
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ Feature: JSON output formatter
},
"result": {
"status": "failed",
"error_message": " (RuntimeError)\n./features/step_definitions/steps.rb:4:in `/^this step fails$/'\nfeatures/one_passing_one_failing.feature:10:in `Given this step fails'",
"error_message": " (RuntimeError)\n./features/step_definitions/steps.rb:4:in `/^this step fails$/'\nfeatures/one_passing_one_failing.feature:10:in `this step fails'",
"duration": 1
}
}
Expand Down Expand Up @@ -246,7 +246,7 @@ Feature: JSON output formatter
},
"result": {
"status": "failed",
"error_message": "a string (RuntimeError)\n./features/step_definitions/steps.rb:2:in `/I should fail with/'\nfeatures/doc_string.feature:4:in `Then I should fail with'",
"error_message": "a string (RuntimeError)\n./features/step_definitions/steps.rb:2:in `/I should fail with/'\nfeatures/doc_string.feature:4:in `I should fail with'",
"duration": 1
}
}
Expand Down Expand Up @@ -357,7 +357,7 @@ Feature: JSON output formatter
},
"result": {
"status": "failed",
"error_message": " (RuntimeError)\n./features/step_definitions/steps.rb:4:in `/^this step fails$/'\nfeatures/outline.feature:9:in `Given this step fails'\nfeatures/outline.feature:4:in `Given this step <status>'",
"error_message": " (RuntimeError)\n./features/step_definitions/steps.rb:4:in `/^this step fails$/'\nfeatures/outline.feature:9:4:in `this step fails'",
"duration": 1
}
}
Expand Down Expand Up @@ -503,7 +503,7 @@ Feature: JSON output formatter
},
"result": {
"status": "failed",
"error_message" : " (RuntimeError)\n./features/step_definitions/steps.rb:4:in `/^this step fails$/'\nfeatures/outline.feature:9:in `Given this step fails'\nfeatures/outline.feature:4:in `Given this step <status>'",
"error_message" : " (RuntimeError)\n./features/step_definitions/steps.rb:4:in `/^this step fails$/'\nfeatures/outline.feature:9:4:in `this step fails'",
"duration": 1
}
}
Expand Down
Loading

0 comments on commit 7f43c95

Please sign in to comment.