Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stringifying location for more consistent json parsing - address #945 #949

Merged
merged 1 commit into from
Feb 11, 2016

Conversation

larryprice
Copy link

I started running into issues when formatting cucumber reports as JSON. With the default JSON gem (also I believe 'oj' and 'yajl'), it seems that the JSON formatter has started stringifying the location object on steps as hashes instead of using the to_s method found in cucumber-ruby-core.

Desired Output:

"location": "features/step_definitions/selenium/selenium.rb:8"

Undesired Output:

              "location": {
                "filepath": {
                  "filename": "json_spec-1.1.4/lib/json_spec/cucumber.rb"
                },
                "lines": {
                  "data": [
                    "5"
                    ]
                  }
                }

This issue does not occur when running the spec tests using the json_spec gem, but happens every time with the classic ruby JSON gem (1.8.3). I added a to_s call when creating the match hash, which doesn't seem to have any other repercussions besides fixing this bug.

Fixes #945.

@brasmusson brasmusson merged commit 3153491 into cucumber:master Feb 11, 2016
brasmusson added a commit that referenced this pull request Feb 11, 2016
@brasmusson
Copy link
Contributor

In the end we want the the string that action_location#to_s returns in the JSON file, so I see no problem with calling it explicitly in the JSON formatter.

@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Different location objects in json report.
2 participants