-
-
Notifications
You must be signed in to change notification settings - Fork 117
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
Merge rules and recommendations from betterspecs.org #55
Conversation
8a7f405
to
e472490
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m just a few commits into this pull request, and I already disagree with a whole lot of things :-) (I’ll just leave 2 of my inline comments)
Would you prefer that we discuss all issues in this PR, or should we merge it as-is and discuss changes in separate issues afterwards?
@bquorning I feel the same pain, but I don't feel I could abuse my style guide editor permissions to only selectively pick or to modify those rules on my own when they come from a guide with over 3000 stars. Let's start the discussion here, and see how it goes. |
Thanks a lot ! |
Original links: http://www.betterspecs.org/#expect http://lelylan.github.io/betterspecs/#expect Discussion: betterspecs/betterspecs#83 https://github.com/lelylan/betterspecs/blob/gh-pages/index.html#L295 https://github.com/yujinakayama/transpec can help converting the old syntax to the new one. Reasoning: http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax http://myronmars.to/n/dev-blog/2013/07/the-plan-for-rspec-3#what_about_the_old_expectationmock_syntax
a53bdcf
to
1204694
Compare
Original links: http://www.betterspecs.org/#formatter http://lelylan.github.io/betterspecs/#formatter Discussion: betterspecs/betterspecs#19 https://github.com/lelylan/betterspecs/blob/gh-pages/index.html#L923 Related: http://jeffkreeftmeijer.com/2010/fuubar-the-instafailing-rspec-progress-bar-formatter/
Original links: http://www.betterspecs.org/#spork http://lelylan.github.io/betterspecs/#faster Discussion: betterspecs/betterspecs#17 https://github.com/lelylan/betterspecs/blob/gh-pages/index.html#L844 https://github.com/jstorimer/spin and https://github.com/sporkrb/spork mentioned in the original recommendation are long (since circa 2014) unmaintained, so it doesn't make much sense to drag them through. Spring became the de-facto standard for Rails.
1204694
to
bd02acf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am sorry @pirj, I forgot to review the rest of your PR in due time. Turned out I had a few extra comments that I hope it’s ok to add here. I think opening a new issue for each of them is overkill, at least initially.
are not nearly as maintainable as factories. | ||
Use [Factory Bot](https://github.com/thoughtbot/factory_bot) to | ||
create test data in integration tests. You should very rarely | ||
have to use `ModelName.create` within an integration spec. Do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the ModelName.create
example is specific to Rails. Should we consider moving this section down to Rails - models
section, or perhaps just add a note in the text?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wording implies Rails, but the advice itself is quite generic. Fixtures here are some objects kept in an storage, not even necessarily database. Also:
Although factory_bot is written to work with ActiveRecord out of the box, it can also work with any Ruby class.
I'd rather keep the rule in this section, but changed ModelName.create
into something that applies both to ActiveRecord and, say, file system.
@bquorning thanks for the review, it's better late than never 👍 |
https://github.com/lelylan/betterspecs are not actively maintained, but
contain a lot of useful material that fits this style guide quite well.
The license of Betterspecs allow for derivative work, and there were no
objections on
picking the material to this guide.
What has been done
gh-pages
gh-pages
)<code>
,<p>
)fivebar
(along withfuubar
)What has not been done
Translations to the other languages originally present in the original (e.g. fr, jp, zh_ch, ...), that would be problematic without the knowledge of most of those languages and considering wording changes of the original rules I've made
Links to the books and presentations
Superseded by what is already in this style guide:
Links to commits, one rule per commit
Open questions
1. Should we merge as one change, or should I better split them intoMerging as one should be good.separate pull requests?
(listed above in "What has not been done" section) somehow?