Skip to content

Commit

Permalink
Don't worry about ambiguous blocks in RSpec
Browse files Browse the repository at this point in the history
Rubocop 0.48 introduced a new Lint/AmbiguousBlockAssocation cop [1], which
guards against the issues detailed in
rubocop/rubocop#3931.

However, the pattern is a solid RSpec idiom and not likely to cause the problems
Lint/AmbigiousBlockAssociation attempts to guard against. For example:

    expect { foo }.to change { bar }

so we'll just ignore it in RSpec as suggested in
rubocop/rubocop#4222.

[1]: https://github.com/bbatsov/rubocop/blob/d1b9d66c3518389b0c408a6a4a42061b36748df4/relnotes/v0.48.0.md
  • Loading branch information
koppen committed May 26, 2017
1 parent 4f4c44e commit d2a9fbf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ AllCops:
- 'db/schema.rb'
- 'node_modules/**/*.rb'

Lint/AmbiguousBlockAssociation:
Exclude:
- "spec/**/*"

Lint/EndAlignment:
EnforcedStyleAlignWith: variable

Expand Down

0 comments on commit d2a9fbf

Please sign in to comment.