You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ pdk new module whatever --skip-interview
$ cd whatever
$ echo "hosts.each { |_x| install_puppet } unless ENV['BEAKER_provision'] == 'no'" >spec/spec_helper_local.rb
$ pdk bundle exec rubocop --debug spec/spec_helper_local.rb
pdk (INFO): Using Ruby 2.7.3
pdk (INFO): Using Puppet 7.9.0
warning: parser/current is loading parser/ruby27, which recognizes
warning: 2.7.4-compliant syntax, but you are running 2.7.3.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
For /home/me/whatever: configuration from /home/me/whatever/.rubocop.yml
configuration from /opt/puppetlabs/pdk/share/cache/ruby/2.7.0/gems/rubocop-performance-1.9.1/config/default.yml
configuration from /opt/puppetlabs/pdk/share/cache/ruby/2.7.0/gems/rubocop-performance-1.9.1/config/default.yml
Default configuration from /opt/puppetlabs/pdk/share/cache/ruby/2.7.0/gems/rubocop-1.6.1/config/default.yml
configuration from /opt/puppetlabs/pdk/share/cache/ruby/2.7.0/gems/rubocop-rspec-2.0.1/config/default.yml
configuration from /opt/puppetlabs/pdk/share/cache/ruby/2.7.0/gems/rubocop-rspec-2.0.1/config/default.yml
Inspecting 1 file
Scanning /home/me/whatever/spec/spec_helper_local.rb
C
Offenses:
spec/spec_helper_local.rb:1:1: C: RSpec/IteratedExpectation: Prefer using the all matcher instead of iterating over an array.
hosts.each { |_x| install_puppet } unless ENV['BEAKER_provision'] == 'no'
^^^^^^^^^^
RuboCop version
$ pdk bundle exec rubocop -V
pdk (INFO): Using Ruby 2.7.3
pdk (INFO): Using Puppet 7.9.0
warning: parser/current is loading parser/ruby27, which recognizes
warning: 2.7.4-compliant syntax, but you are running 2.7.3.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
1.6.1 (using Parser 3.0.2.0, rubocop-ast 1.10.0, running on ruby 2.7.3 x86_64-linux)
- rubocop-performance 1.9.1
- rubocop-rspec 2.0.1
The text was updated successfully, but these errors were encountered:
PDK v2.2.0 using rubocop v1.6.1 (pdk enforces the rubocop version, so sorry if this has been fixed already).
Expected behavior
Rubocop would distinguish between plain ruby and rspec DSL.
Actual behavior
Given the line
I get
Steps to reproduce the problem
RuboCop version
The text was updated successfully, but these errors were encountered: