Sha256: 25327b878ac0a4aed8b970e02cd40dd1301cb3a2a5b64af85631cebfd498fc88

Contents?: true

Size: 743 Bytes

Versions: 4

Compression:

Stored size: 743 Bytes

Contents

require 'spec_helper'

describe LintTrap::Linter::CPPCheck do
  let(:container){LintTrap::Container::Fake.new}
  let(:config){nil}
  let(:files){%w(good.cpp bad.cpp)}
  subject(:linter){described_class.new(container: container, config: config)}
  let(:command){instance_double(LintTrap::Command)}

  describe '#lint' do
    it 'runs the lint command with the correct arguments' do
      expect(LintTrap::Command).to receive(:new).with(
        'cppcheck',
        [
          '--enable=all',
          '--error-exitcode=1',
          '--template="{file}:{line}:::{id}:{severity}:{message}"'
        ],
        files
      ).and_return(command)
      expect(command).to receive(:run).with(container)

      linter.lint(files)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lint_trap-0.0.6 spec/linter/cppcheck_spec.rb
lint_trap-0.0.5 spec/linter/cppcheck_spec.rb
lint_trap-0.0.4 spec/linter/cppcheck_spec.rb
lint_trap-0.0.3 spec/linter/cppcheck_spec.rb