Sha256: a4e7c399543eab71018821492994974b046d197d33d1bc1be8264b54e9ad241b

Contents?: true

Size: 1.08 KB

Versions: 24

Compression:

Stored size: 1.08 KB

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
      |  StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Foo
      |
      |RSpec/Bar:
      |  Enabled: true
      |  Description: Wow
      |  StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Bar
    YAML
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
rubocop-rspec-1.32.0 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.31.0 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.30.1 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.30.0 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.29.1 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.29.0 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.28.0 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.27.0 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.26.0 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.25.1 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.25.0 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.24.0 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.23.0 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.22.2 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.22.1 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.22.0 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.21.0 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.20.1 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.20.0 spec/rubocop/rspec/config_formatter_spec.rb
rubocop-rspec-1.19.0 spec/rubocop/rspec/config_formatter_spec.rb