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
rubocop doesn't throw any failures for the code snippet below
Actual behavior
rubocop throws 1 failure
C: Style/MixinUsage: include is used at the top level. Use inside class or module.
include Spec::Rails::Matchers if defined?(Spec::Rails::Matchers)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Steps to reproduce the problem
class CopTest; end
[CopTest].each do |klass|
klass.class_eval do
include Spec::Matchers
include Spec::Rails::Matchers if defined?(Spec::Rails::Matchers)
end
end
Expected behavior
rubocop doesn't throw any failures for the code snippet below
Actual behavior
rubocop throws 1 failure
Steps to reproduce the problem
RuboCop version
The issue is the
if
statement. As you can see when running this that the includeSpec::Matchers
line doesn't complain.The text was updated successfully, but these errors were encountered: