Sha256: 87e292a9a0638fb614648dd2a8896d57a4e35151774b8c1e4a119600eb801b9f

Contents?: true

Size: 449 Bytes

Versions: 5

Compression:

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

    hash = { described_class.cop_name => cop_config }
    Rubocop::Config.new(hash)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rubocop-0.15.0 spec/support/shared_context.rb
rubocop-0.14.1 spec/support/shared_context.rb
rubocop-0.14.0 spec/support/shared_context.rb
rubocop-0.13.1 spec/support/shared_context.rb
rubocop-0.13.0 spec/support/shared_context.rb