Sha256: 0d995b8b16f8ab59dbddd324cd6e8a1ed42c133f60c2d1a7f4b278e1182c0bd0

Contents?: true

Size: 550 Bytes

Versions: 7

Compression:

Stored size: 550 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

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

    cop_name = described_class.cop_name
    hash = {
      cop_name =>
      Rubocop::ConfigLoader.default_configuration[cop_name].merge(cop_config)
    }
    Rubocop::Config.new(hash)
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
ridecharge-rubocop-0.0.1 spec/support/shared_context.rb
rubocop-0.19.1 spec/support/shared_context.rb
rubocop-0.19.0 spec/support/shared_context.rb
rubocop-0.18.1 spec/support/shared_context.rb
rubocop-0.18.0 spec/support/shared_context.rb
rubocop-0.17.0 spec/support/shared_context.rb
rubocop-0.16.0 spec/support/shared_context.rb