Skip to content

Conversation

@mauro-oto
Copy link
Contributor

Adds a missing backtick on unknown in the invalid block banner.

@mauro-oto
Copy link
Contributor Author

Weird, the test passes locally on 2.6.6, which CI seems to be using for 2.6. I guess we could remove the test, and just fix the typo if you prefer @schneems.

@schneems
Copy link
Collaborator

I am seeing a failure locally. I'll dig in now

Failures:

  1) DeadEnd::DisplayInvalidBlocks Unmatched unknown banner
     Failure/Error: expect(display.banner).to include("DeadEnd: Unmatched `unknown` detected")
       expected nil to include "DeadEnd: Unmatched `unknown` detected", but it does not respond to `include?`
     # ./spec/unit/display_invalid_blocks_spec.rb:69:in `block (2 levels) in <module:DeadEnd>'

Finished in 6.61 seconds (files took 0.21497 seconds to load)
84 examples, 1 failure

Failed examples:

rspec ./spec/unit/display_invalid_blocks_spec.rb:54 # DeadEnd::DisplayInvalidBlocks Unmatched unknown banner

@schneems
Copy link
Collaborator

In 2.6.6 (for me) case @invalid_obj.error_symbol returns :unknown which is a case we're not handling. We're only handling if case @invalid_obj.unmatched_symbol is unknown.

This failing test accidentally shows an edge case that we're not handling.

Apparently depending on the sub version of Ruby 2.6 and the specific syntax, the error may or may not include the comma.

Ruby 2.5 has different cases for `Unexpected end` and `unexpected end`.
@schneems schneems force-pushed the fix-typo-for-unmatched-unknown branch from 01ad82e to a2ffec2 Compare February 10, 2021 16:29
@schneems schneems changed the title Added missing backtick on 'unmatched unknown detected' [changelog skip] Added missing backtick on 'unmatched unknown detected' Feb 10, 2021
@schneems
Copy link
Collaborator

It turns out the WhoDisSyntaxError didn't handle a few different syntax cases. I've pushed a commit to your branch to fix the issue.

@schneems schneems merged commit 111e0e2 into main Feb 10, 2021
@schneems schneems deleted the fix-typo-for-unmatched-unknown branch February 10, 2021 16:55
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

Successfully merging this pull request may close these issues.

3 participants