Sha256: a019649829e92673d231337918975a98baddb0f19e58995d7fd190bf840b649e

Contents?: true

Size: 563 Bytes

Versions: 1

Compression:

Stored size: 563 Bytes

Contents

# encoding: utf-8

# `cop_config` must be declared with #let.
shared_context 'config', :config do
  let(:config) do
    # Module#<
    unless described_class < Rubocop::Cop::Cop
      fail '`config` must be used in `describe SomeCopClass do .. end`'
    end

    fail '`cop_config` must be declared with #let' unless cop_config.is_a?(Hash)

    cop_name = described_class.cop_name
    hash = {
      cop_name =>
      Rubocop::ConfigLoader.default_configuration[cop_name].merge(cop_config)
    }
    Rubocop::Config.new(hash, "#{Dir.pwd}/.rubocop.yml")
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubocop-0.22.0 spec/support/shared_context.rb