lib/rubocop/rspec/config_formatter.rb in rubocop-rspec-1.16.0 vs lib/rubocop/rspec/config_formatter.rb in rubocop-rspec-1.17.0
- old
+ new
@@ -2,12 +2,12 @@
module RuboCop
module RSpec
# Builds a YAML config file from two config hashes
class ConfigFormatter
- NAMESPACES = /^(#{Regexp.union('RSpec', 'FactoryGirl')})/
- STYLE_GUIDE_BASE_URL = 'http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/'.freeze
+ NAMESPACES = /^(#{Regexp.union('RSpec', 'Capybara', 'FactoryGirl')})/
+ STYLE_GUIDE_BASE_URL = 'http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/'.freeze
def initialize(config, descriptions)
@config = config
@descriptions = descriptions
end
@@ -20,10 +20,10 @@
def unified_config
cops.each_with_object(config.dup) do |cop, unified|
unified[cop] = config.fetch(cop)
.merge(descriptions.fetch(cop))
- .merge('StyleGuide' => STYLE_GUIDE_BASE_URL + cop)
+ .merge('StyleGuide' => STYLE_GUIDE_BASE_URL + cop.sub('RSpec/', ''))
end
end
def cops
(descriptions.keys | config.keys).grep(NAMESPACES)