Skip to content

Commit

Permalink
Merge pull request #1233 from rubocop/adoc-fixes
Browse files Browse the repository at this point in the history
Fix a bit of asciidoc formatting
  • Loading branch information
pirj authored Jan 23, 2022
2 parents 9192504 + acf3c61 commit 569abea
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Layout/HashAlignment:

Layout/LineLength:
Max: 80 # default: 120
IgnoredPatterns:
- '^\s*# .*https?:\/\/.+\[.+\]\.?$' # Allow long asciidoc links

Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Expand Down
2 changes: 1 addition & 1 deletion config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ RSpec/Capybara/FeatureMethods:
Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/FeatureMethods

RSpec/Capybara/VisibilityMatcher:
Description: Checks for boolean visibility in capybara finders.
Description: Checks for boolean visibility in Capybara finders.
Enabled: true
VersionAdded: '1.39'
VersionChanged: '2.0'
Expand Down
19 changes: 10 additions & 9 deletions docs/modules/ROOT/pages/cops_rspec_capybara.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

Checks that no expectations are set on Capybara's `current_path`.

The `have_current_path` matcher (https://www.rubydoc.info/github/
teamcapybara/capybara/master/Capybara/RSpecMatchers#have_current_path-
instance_method) should be used on `page` to set expectations on
Capybara's current path, since it uses Capybara's waiting
functionality (https://github.com/teamcapybara/capybara/blob/master/
README.md#asynchronous-javascript-ajax-and-friends) which ensures that
preceding actions (like `click_link`) have completed.
The
https://www.rubydoc.info/github/teamcapybara/capybara/master/Capybara/RSpecMatchers#have_current_path-instance_method[`have_current_path` matcher]
should be used on `page` to set expectations on Capybara's
current path, since it uses
https://github.com/teamcapybara/capybara/blob/master/README.md#asynchronous-javascript-ajax-and-friends[Capybara's waiting functionality]
which ensures that preceding actions (like `click_link`) have
completed.

=== Examples

Expand Down Expand Up @@ -118,15 +118,16 @@ end
| 2.0
|===

Checks for boolean visibility in capybara finders.
Checks for boolean visibility in Capybara finders.

Capybara lets you find elements that match a certain visibility using
the `:visible` option. `:visible` accepts both boolean and symbols as
values, however using booleans can have unwanted effects. `visible:
false` does not find just invisible elements, but both visible and
invisible elements. For expressiveness and clarity, use one of the
symbol values, `:all`, `:hidden` or `:visible`.
(https://www.rubydoc.info/gems/capybara/Capybara%2FNode%2FFinders:all)
Read more in
https://www.rubydoc.info/gems/capybara/Capybara%2FNode%2FFinders:all[the documentation].

=== Examples

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RuboCop https://docs.rubocop.org/rubocop/configuration.html#inheriting-configura

== Packaging configuration for RuboCop RSpec

NOTE: Due to a [bug](https://github.com/rubocop/rubocop-rspec/issues/1126), this feature doesn't work properly for `rubocop-rspec` 2.5.0 and earlier versions.
NOTE: Due to https://github.com/rubocop/rubocop-rspec/issues/1126[a bug], this feature doesn't work properly for `rubocop-rspec` 2.5.0 and earlier versions.

For a third-party gem, it's sufficient to follow three steps:

Expand Down
14 changes: 7 additions & 7 deletions lib/rubocop/cop/rspec/capybara/current_path_expectation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ module RSpec
module Capybara
# Checks that no expectations are set on Capybara's `current_path`.
#
# The `have_current_path` matcher (https://www.rubydoc.info/github/
# teamcapybara/capybara/master/Capybara/RSpecMatchers#have_current_path-
# instance_method) should be used on `page` to set expectations on
# Capybara's current path, since it uses Capybara's waiting
# functionality (https://github.com/teamcapybara/capybara/blob/master/
# README.md#asynchronous-javascript-ajax-and-friends) which ensures that
# preceding actions (like `click_link`) have completed.
# The
# https://www.rubydoc.info/github/teamcapybara/capybara/master/Capybara/RSpecMatchers#have_current_path-instance_method[`have_current_path` matcher]
# should be used on `page` to set expectations on Capybara's
# current path, since it uses
# https://github.com/teamcapybara/capybara/blob/master/README.md#asynchronous-javascript-ajax-and-friends[Capybara's waiting functionality]
# which ensures that preceding actions (like `click_link`) have
# completed.
#
# @example
# # bad
Expand Down
5 changes: 3 additions & 2 deletions lib/rubocop/cop/rspec/capybara/visibility_matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ module RuboCop
module Cop
module RSpec
module Capybara
# Checks for boolean visibility in capybara finders.
# Checks for boolean visibility in Capybara finders.
#
# Capybara lets you find elements that match a certain visibility using
# the `:visible` option. `:visible` accepts both boolean and symbols as
# values, however using booleans can have unwanted effects. `visible:
# false` does not find just invisible elements, but both visible and
# invisible elements. For expressiveness and clarity, use one of the
# symbol values, `:all`, `:hidden` or `:visible`.
# (https://www.rubydoc.info/gems/capybara/Capybara%2FNode%2FFinders:all)
# Read more in
# https://www.rubydoc.info/gems/capybara/Capybara%2FNode%2FFinders:all[the documentation].
#
# @example
#
Expand Down

0 comments on commit 569abea

Please sign in to comment.