Sha256: 7a942a7f4bb5025f7503750addb5ca7aa98eecccd4d3a24ad1905d7cc55c0ba0

Contents?: true

Size: 834 Bytes

Versions: 5

Compression:

Stored size: 834 Bytes

Contents

require 'spec_helper'

describe LintTrap::Command do
  let(:file){fixture_path('lint.txt')}
  let(:command){described_class.new('cat', %w(-b), [file])}
  let(:container){LintTrap::Container::Docker.new('lintci/spin_cycle', fixture_path)}

  describe '#run' do
    it 'generates the expected output' do
      command.run(container) do |io|
        expect(io.read).to eq("     1\tlint\n")
      end
    end
  end

  describe '#command/#to_s' do
    it 'generates a wrapped executable command' do
      expect(command.to_s(container)).to eq(
        "docker run --privileged=false -v #{LintTrap::Container::Base::LOCAL_CONFIG_PATH}:/opt/lint_trap/config "\
        "-v #{fixture_path}:/home/spin_cycle --workdir=/home/spin_cycle --user=spin_cycle lintci/spin_cycle "\
        'cat -b /home/spin_cycle/lint.txt'
      )
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lint_trap-0.0.11 spec/command_spec.rb
lint_trap-0.0.10 spec/command_spec.rb
lint_trap-0.0.9 spec/command_spec.rb
lint_trap-0.0.8 spec/command_spec.rb
lint_trap-0.0.7 spec/command_spec.rb