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

Enables test bang on all specs #606

Merged
merged 1 commit into from
Jan 24, 2019

Conversation

LeoColman
Copy link
Member

Before this, some specs couldn't be marked as banged with a !. This happened due to the fact that we check for a exclamation mark at the beginning of a test name, such as "Foo" -> "!Foo" would be banged in FreeSpec.

However, some specs such as BehaviorSpec wouldn't allow this to work, as Given("!Foo") would be turned into Given: !Foo. When we checked for the start of the test name, it wouldn't contain !, therefore it wouldn't be ignored.

This commit changes all specs that would fall in that scenario, to move an exclamation mark from the beginning of the test chosen name to the beginning of the test final name (Before Given, for example. Given("!Foo") -> "!Given: Foo"), fixing this issue.

I chose to do it this way to keep consistent. "Why did this test get ignored?" would be better visualized when Given is prefixed with !, and not if we edited the bang mechanism to consider only the test name, and not the prefix.

Fixes #605

@LeoColman LeoColman force-pushed the bugfix/605-bang-and-focus-outside-string-spec branch from eb9de82 to 0813b88 Compare January 24, 2019 12:24
Before this, some specs couldn't be marked as banged with a `!`. This happened due to the fact that we check for a exclamation mark at the beginning of a test name, such as "Foo" -> "!Foo" would be banged in FreeSpec.

However, some specs such as `BehaviorSpec` wouldn't allow this to work, as `Given("!Foo")` would be turned into `Given: !Foo`. When we checked for the start of the test name, it wouldn't contain `!`, therefore it wouldn't be ignored.

This commit changes all specs that would fall in that scenario, to move an exclamation mark from the beginning of the test chosen name to the beginning of the test final name (Before Given, for example. `Given("!Foo") -> "!Given: Foo"`), fixing this issue.

I chose to do it this way to keep consistent. "Why did this test get ignored?" would be better visualized when `Given` is prefixed with `!`, and not if we edited the bang mechanism to consider only the test name, and not the prefix.

Fixes #605
@LeoColman LeoColman merged commit 31d5245 into master Jan 24, 2019
@LeoColman LeoColman deleted the bugfix/605-bang-and-focus-outside-string-spec branch January 24, 2019 12:53
@sksamuel
Copy link
Member

I think we could put this on 3.2 as well and release 3.2.2
We'd need a release/3.2 branch cut from the last 3.2.1 release.

@LeoColman
Copy link
Member Author

We could also remove from master everything that should go to 3.3 only and move it to release/3.3

@LeoColman
Copy link
Member Author

I don't think there's much difference

@sksamuel
Copy link
Member

sksamuel commented Jan 24, 2019 via email

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.

Question: Bang and Focus outside of StringSpec
2 participants