Sha256: 1914e769a2d636e16e116e9d77acb3720f079786be1c147c7d88818ba3bbf178

Contents?: true

Size: 934 Bytes

Versions: 4

Compression:

Stored size: 934 Bytes

Contents

require 'spec_helper'

describe LintTrap::Linter::Base do
  let(:image){LintTrap::Linter::RuboCop.new.image_version}
  let(:container){LintTrap::Container::Docker.new(image, fixture_path, remove_container: ENV['CI'].nil?)}
  let(:options){{}}
  subject(:linter) do
    ErrorLinter = Class.new(described_class) do
      def command_name(_container)
        'ls'
      end

      def flags(_container, _options)
        []
      end

      def parser
        LintTrap::Parser.find('Standard')
      end
    end.new
  end

  describe '#lint' do
    context 'when linting fails' do
      let(:file){fixture_path('this-does-not-exist.rb')}

      it 'raises an error with console output' do
        expect{|b| linter.lint([file], container, options, &b)}.to raise_error(
          described_class::LintError,
          start_with(
            'An error occurred while running `docker run'
          )
        )
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lint_trap-0.0.19 spec/integration/base_spec.rb
lint_trap-0.0.18 spec/integration/base_spec.rb
lint_trap-0.0.17 spec/integration/base_spec.rb
lint_trap-0.0.16 spec/integration/base_spec.rb