Module: EacRubyGemSupport::Rspec::Specs::Rubocop

Included in:
EacRubyGemSupport::Rspec::Setup
Defined in:
lib/eac_ruby_gem_support/rspec/specs/rubocop.rb

Instance Method Summary collapse

Instance Method Details

#describe_rubocopObject

rubocop:disable Metrics/AbcSize, Metrics/MethodLength



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/eac_ruby_gem_support/rspec/specs/rubocop.rb', line 10

def describe_rubocop # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
  this = self
  ::RSpec.describe ::RuboCop do
    before do
      ::RuboCop::ConfigLoader.ignore_parent_exclusion = true
    end

    let(:root_path) { this.app_root_path }
    let(:config_store) do
      r = ::RuboCop::ConfigStore.new
      r.for(root_path)
      r
    end
    let(:runner) { ::RuboCop::Runner.new({}, config_store) }

    it 'rubocop return ok' do
      expect(::Dir.chdir(root_path) { runner.run([]) }).to eq(true)
    end
  end
end