Sha256: 7ed2ed120a1bbffa51c5604581db43fbc332dc3bda3581f5d215488e9116a81d

Contents?: true

Size: 725 Bytes

Versions: 4

Compression:

Stored size: 725 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe 'RuboCop Project' do
  describe '.rubocop.yml' do
    it 'has configuration for all cops' do
      cop_names = Rubocop::Cop::Cop.all.map(&:cop_name)
      expect(Rubocop::Config.load_file('.rubocop.yml').keys.sort)
        .to eq((['AllCops'] + cop_names).sort)
    end
  end

  describe 'source codes', broken: true do
    before { $stdout = StringIO.new }
    after  { $stdout = STDOUT }

    it 'has no violations' do
      # Need to pass an empty array explicitly
      # so that the CLI does not refer arguments of `rspec`
      Rubocop::CLI.new.run([])
      expect($stdout.string).to match(
        /files inspected, no offences detected\n/
      )
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rubocop-0.8.3 spec/project_spec.rb
rubocop-0.8.2 spec/project_spec.rb
rubocop-0.8.1 spec/project_spec.rb
rubocop-0.8.0 spec/project_spec.rb