Class: RuboCop::Capybara::Plugin

Inherits:
LintRoller::Plugin
  • Object
show all
Defined in:
lib/rubocop/capybara/plugin.rb

Overview

A plugin that integrates RuboCop Capybara with RuboCop’s plugin system.

Instance Method Summary collapse

Instance Method Details

#aboutObject

:nocov:



12
13
14
15
16
17
18
19
# File 'lib/rubocop/capybara/plugin.rb', line 12

def about
  LintRoller::About.new(
    name: 'rubocop-capybara',
    version: Version::STRING,
    homepage: 'https://github.com/rubocop/rubocop-capybara',
    description: 'Code style checking for Capybara test files.'
  )
end

#rules(_context) ⇒ Object



26
27
28
29
30
31
32
33
34
# File 'lib/rubocop/capybara/plugin.rb', line 26

def rules(_context)
  project_root = Pathname.new(__dir__).join('../../..')

  LintRoller::Rules.new(
    type: :path,
    config_format: :rubocop,
    value: project_root.join('config/default.yml')
  )
end

#supported?(context) ⇒ Boolean

:nocov:

Returns:

  • (Boolean)


22
23
24
# File 'lib/rubocop/capybara/plugin.rb', line 22

def supported?(context)
  context.engine == :rubocop
end