Sha256: 58b066d2bed16b4be605fa9da513d69476f051feb8cae8a1404105afe69549e9

Contents?: true

Size: 934 Bytes

Versions: 4

Compression:

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

4 entries across 4 versions & 1 rubygems

Version Path
rubocop-rspec-1.15.1 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.15.0 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.14.0 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.13.0 spec/rubocop/rspec/config_formatter_spec.rb