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

RuntimeError crash when a table is not well formatted #5

Open
thinkingerrol opened this issue Jun 27, 2018 · 0 comments
Open

RuntimeError crash when a table is not well formatted #5

thinkingerrol opened this issue Jun 27, 2018 · 0 comments

Comments

@thinkingerrol
Copy link

thinkingerrol commented Jun 27, 2018

Feature: Table formatting

  As a developer,
  I want clear output from gherkin_format, without misleading errors.

  Scenario: Misformatted table
    Given a scenario has a mis-formatted table
      | title  |
      | content |     
    When I run gherkin_format
    Then I don't get a RuntimeError
$ docker run --rm -i -v $(pwd):/src -w /src gherkin/format:0.1.1 test/table.feature
/usr/local/bundle/gems/gherkin_format-0.1.1/lib/gherkin_format.rb:28:in `format': File test/table.feature is not formatted well. (RuntimeError)
        from /usr/local/bundle/gems/gherkin_format-0.1.1/bin/gherkin_format:40:in `block in <top (required)>'
        from /usr/local/bundle/gems/gherkin_format-0.1.1/bin/gherkin_format:39:in `each'
        from /usr/local/bundle/gems/gherkin_format-0.1.1/bin/gherkin_format:39:in `<top (required)>'
        from /usr/local/bundle/bin/gherkin_format:22:in `load'
        from /usr/local/bundle/bin/gherkin_format:22:in `<main>'
File test/table.feature is not formatted well.

Despite the RuntimeError, gherkin_format seems to do the job, at least with -replace is fixes the mis-formatted table. Unfortunately, it does not say that it replaced anything and especially with the RuntimeError it looks like the input was so bad that gherkin_format couldn't do it's job and crashed.

Please fix the RuntimeError and also write out an indication that a file has been changed automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant