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

doc: add shared examples for line checking #28

Merged
merged 1 commit into from Mar 24, 2023

Conversation

benebrice
Copy link
Contributor

No description provided.

@benebrice benebrice force-pushed the doc--line-checker branch 2 times, most recently from a0782fc to 9753980 Compare January 6, 2022 09:37
Signed-off-by: Brice <brice.bene@gmail.com>
```ruby
RSpec.describe V1::MyDelivery do
context "when..." do
it_behaves_like "deliverable", [:mailer], [:some_action]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea.

Can we make the API a bit more explicit? For example:

# single line
it_behaves_like "deliverable", via: :mailer, action: :some_action
# multiple lines
it_behaves_like "deliverable", via: [:mailer, :pusher], action: :some_action

Btw, what is the case for multiple actions? I think, the most common case is to check for a single action; hence, for multiple actions we can just include the shared example multiple times.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I forgot this one! I'll take a look asap. 🙂

For the multiple actions, it was only to avoid to copy/paste the same shared example.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries. I think, we can actually merge this.

@palkan palkan merged commit f45bfd2 into palkan:master Mar 24, 2023
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.

None yet

2 participants