Sha256: 79aa6f8fafdadaa64306f757233e1af18f3057bab04e7b838dbcb3b528005f86

Contents?: true

Size: 764 Bytes

Versions: 3

Compression:

Stored size: 764 Bytes

Contents

require 'spec_helper'

describe LintTrap::Linter::JSONLint do
  let(:container){LintTrap::Container::Fake.new}
  let(:options){{}}
  let(:files){%w(good.go bad.go)}
  subject(:linter){described_class.new}
  let(:command){instance_double(LintTrap::Command)}

  it_behaves_like 'linter'

  its(:languages){is_expected.to eq([LintTrap::Language::JSON.new])}

  describe '#lint' do
    it 'runs the lint command with the correct arguments' do
      expect(LintTrap::Command).to receive(:new).with(
        'durable-json-lint',
        ['--format', '{{file}}:{{line}}:{{column}}:::error:{{{description}}}'],
        files
      ).and_return(command)
      expect(command).to receive(:run).with(container)

      linter.lint(files, container, options)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lint_trap-0.0.11 spec/linter/jsonlint_spec.rb
lint_trap-0.0.10 spec/linter/jsonlint_spec.rb
lint_trap-0.0.9 spec/linter/jsonlint_spec.rb