Sha256: 7fb7be4ce10ec742dff9ca7fce1895e81c19ef8b592318842b9b77c945b7ac4c

Contents?: true

Size: 910 Bytes

Versions: 7

Compression:

Stored size: 910 Bytes

Contents

require 'rubocop/rspec/config_formatter'

RSpec.describe RuboCop::RSpec::ConfigFormatter do
  let(:config) do
    {
      'AllCops' => {
        'Setting' => 'fourty two'
      },
      'RSpec/Foo' => {
        'Config'      => 2,
        'Enabled'     => true
      },
      'RSpec/Bar' => {
        'Enabled'     => true
      }
    }
  end

  let(:descriptions) do
    {
      'RSpec/Foo' => {
        'Description' => 'Blah'
      },
      'RSpec/Bar' => {
        'Description' => 'Wow'
      }
    }
  end

  it 'builds a YAML dump with spacing between cops' do
    formatter = described_class.new(config, descriptions)

    expect(formatter.dump).to eql(<<-YAML.gsub(/^\s+\|/, ''))
    |---
    |AllCops:
    |  Setting: fourty two
    |
    |RSpec/Foo:
    |  Config: 2
    |  Enabled: true
    |  Description: Blah
    |
    |RSpec/Bar:
    |  Enabled: true
    |  Description: Wow
    YAML
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rubocop-rspec-1.12.0 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.11.0 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.10.0 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.9.1 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.9.0 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.8.0 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.7.0 spec/rubocop/rspec/config_formatter_spec.rb