Role models are important.
Tip
|
You can find a beautiful version of this guide with much improved navigation at https://capybara.rubystyle.guide. |
This Capybara style guide outlines the recommended best practices for real-world programmers to write code that can be maintained by other real-world programmers.
RuboCop, a static code analyzer (linter) and formatter, has a rubocop-capybara
extension, provides a way to enforce the rules outlined in this guide.
You can generate a PDF copy of this guide using AsciiDoctor PDF, and an HTML copy with AsciiDoctor using the following commands:
# Generates README.pdf
asciidoctor-pdf -a allow-uri-read README.adoc
# Generates README.html
asciidoctor README.adoc
Tip
|
Install the gem install rouge |
This guide is work in progress - trying to fill in the arguments by which the rubocop-capbyara cops were written so that users can undestand the tradeoffs on different approaches (whether to configure, enable or disable different cops) and understand where it’s a question of consistency and/or style, or are there other issues at play.
(corresponds to Capybara/ClickLinkOrButtonStyle)
(also corresponds to Capybara/ClickLinkOrButtonStyle)
(corresponds to Capybara/CurrentPathExpectation)
(corresponds to Capybara/MatchStyle)
(corresponds to Capybara/NegationMatcher)
(corresponds to Capybara/RedundantWithinFind)
(corresponds to Capybara/SpecificActions)
(corresponds to Capybara/SpecificFinders)
(corresponds to Capybara/SpecificMatcher)
(corresponds to Capybara/VisibilityMatcher)
(corresponds to Capybara/RSpec/HaveSelector)
(corresponds to Capybara/RSpec/PredicateMatcher)
Nothing written in this guide is set in stone. Everyone is welcome to contribute, so that we could ultimately create a resource that will be beneficial to the entire Ruby community.
Feel free to open tickets or send pull requests with improvements. Thanks in advance for your help!
You can also support the project (and RuboCop) with financial contributions via Patreon.
It’s easy, just follow the contribution guidelines below:
-
Make your feature addition or bug fix in a feature branch
-
Include a good description of your changes
-
Push your feature branch to GitHub
-
Send a Pull Request
This work is licensed under a Creative Commons Attribution 3.0 Unported License
TBC!