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

RSpec syntax to test guard clauses #807

Open
Leee-xx opened this issue Jan 23, 2023 · 0 comments
Open

RSpec syntax to test guard clauses #807

Leee-xx opened this issue Jan 23, 2023 · 0 comments

Comments

@Leee-xx
Copy link

Leee-xx commented Jan 23, 2023

Is your feature request related to a problem? Please describe.
If I add a guard clause, some of my event tests will fail if the guard clause isn't returning true. I either have to mock the guard to return true or add multiple scenarios to test for each guard state.

Describe the solution you'd like
RSpec syntax along the lines of .with_guard(:my_guard) (or something similar to https://github.com/jdliss/shoulda-callback-matchers).

Describe alternatives you've considered
I either have to mock the guard to return true or add multiple scenarios to test for each guard state.

Additional context
n/a

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