Skip to content

Commit

Permalink
Merge #1243 'Change to use the gherkin step location in the Json form…
Browse files Browse the repository at this point in the history
…atter'

Also update Changelog.md.
  • Loading branch information
brasmusson committed Jul 13, 2018
2 parents 9589e9d + 03e8163 commit 0377bf3
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Expand Up @@ -18,7 +18,11 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo

### Changed

* N/A
* Upgraded to `cucumber-core` 3.2.0
* Change to use the gherkin step location in the Json formatter.
([#1243](https://github.com/cucumber/cucumber-ruby/pull/1243),
[#1108](https://github.com/cucumber/cucumber-ruby/issues/1108)
[brasmusson](https://github.com/brasmusson))

### Deprecated

Expand Down
2 changes: 1 addition & 1 deletion cucumber.gemspec
Expand Up @@ -13,7 +13,7 @@ Gem::Specification.new do |s|
# Keep in sync with .circleci/config.yml & .rubocop.yml
s.required_ruby_version = '>= 2.2'
s.add_dependency 'builder', '>= 2.1.2'
s.add_dependency 'cucumber-core', '~> 3.1.0'
s.add_dependency 'cucumber-core', '~> 3.2.0'
s.add_dependency 'cucumber-expressions', '~> 6.0.1'
s.add_dependency 'cucumber-wire', '~> 0.0.1'
s.add_dependency 'diff-lcs', '~> 1.3'
Expand Down
16 changes: 8 additions & 8 deletions features/docs/formatters/json_formatter.feature
Expand Up @@ -420,7 +420,7 @@ Feature: JSON output formatter
{
"keyword": "Given ",
"name": "this step passes",
"line": 8,
"line": 4,
"match": {
"location": "features/step_definitions/steps.rb:1"
},
Expand All @@ -442,7 +442,7 @@ Feature: JSON output formatter
{
"keyword": "Given ",
"name": "this step fails",
"line": 9,
"line": 4,
"match": {
"location": "features/step_definitions/steps.rb:4"
},
Expand All @@ -465,7 +465,7 @@ Feature: JSON output formatter
{
"keyword": "Given ",
"name": "this step passes",
"line": 13,
"line": 4,
"match": {
"location": "features/step_definitions/steps.rb:1"
},
Expand Down Expand Up @@ -566,7 +566,7 @@ Feature: JSON output formatter
{
"keyword": "Given ",
"name": "this step passes",
"line": 8,
"line": 4,
"match": {
"location": "features/step_definitions/steps.rb:1"
},
Expand All @@ -588,7 +588,7 @@ Feature: JSON output formatter
{
"keyword": "Given ",
"name": "this step fails",
"line": 9,
"line": 4,
"match": {
"location": "features/step_definitions/steps.rb:4"
},
Expand All @@ -611,7 +611,7 @@ Feature: JSON output formatter
{
"keyword": "Given ",
"name": "this step passes",
"line": 13,
"line": 4,
"match": {
"location": "features/step_definitions/steps.rb:1"
},
Expand Down Expand Up @@ -680,7 +680,7 @@ Feature: JSON output formatter
{
"keyword": "Given ",
"name": "I embed data directly",
"line": 11,
"line": 7,
"embeddings": [
{
"mime_type": "mime-type",
Expand Down Expand Up @@ -708,7 +708,7 @@ Feature: JSON output formatter
{
"keyword": "Given ",
"name": "I embed data directly",
"line": 12,
"line": 7,
"embeddings": [
{
"mime_type": "mime-type",
Expand Down
2 changes: 1 addition & 1 deletion lib/cucumber/formatter/json.rb
Expand Up @@ -163,7 +163,7 @@ def create_step_hash(step_source)
step_hash = {
keyword: step_source.keyword,
name: step_source.to_s,
line: step_source.location.line
line: step_source.original_location.line
}
step_hash[:comments] = Formatter.create_comments_array(step_source.comments) unless step_source.comments.empty?
step_hash[:doc_string] = create_doc_string_hash(step_source.multiline_arg) if step_source.multiline_arg.doc_string?
Expand Down
6 changes: 3 additions & 3 deletions spec/cucumber/formatter/json_spec.rb
Expand Up @@ -198,7 +198,7 @@ module Formatter
"steps":
[{"keyword": "Given ",
"name": "there are bananas",
"line": 8,
"line": 4,
"match": {"location": "spec/cucumber/formatter/json_spec.rb:180"},
"result": {"status": "passed",
"duration": 1}}]}]}]})
Expand Down Expand Up @@ -271,7 +271,7 @@ module Formatter
"steps":
[{"keyword": "Given ",
"name": "there are bananas",
"line": 15,
"line": 10,
"match": {"location": "spec/cucumber/formatter/json_spec.rb:228"},
"result": {"status": "passed",
"duration": 1}}]}]}]})
Expand Down Expand Up @@ -380,7 +380,7 @@ module Formatter
"steps":
[{"keyword": "Then ",
"name": "the monkey eats bananas",
"line": 22,
"line": 16,
"comments": [{"value": "#step comment2",
"line": 15}],
"match": {"location": "spec/cucumber/formatter/json_spec.rb:309"},
Expand Down

0 comments on commit 0377bf3

Please sign in to comment.