Sha256: 9114368952f2193f7a6c849f95b2efba3e39e95db2b7b1ade271d9cfe6282fd4

Contents?: true

Size: 1.18 KB

Versions: 72

Compression:

Stored size: 1.18 KB

Contents

require 'spec_helper'
require 'r10k/util/subprocess'

describe R10K::Util::Subprocess::Result do
  describe "formatting" do
    it "includes the exit code" do
      result = described_class.new(%w[/usr/bin/gti --zoom], '', '', 42)
      expect(result.format).to match(%r[Exit code: 42])
    end

    describe "stdout" do
      it "is omitted when empty" do
        result = described_class.new(%w[/usr/bin/gti --zoom], '', '', 42)
        expect(result.format).to_not match(%r[Stdout])
      end
      it "is included when non-empty" do
        result = described_class.new(%w[/usr/bin/gti --zoom], 'stuff here', '', 42)
        expect(result.format).to match(%r[Stdout:])
        expect(result.format).to match(%r[stuff here])
      end
    end

    describe "stderr" do
      it "is omitted when empty" do
        result = described_class.new(%w[/usr/bin/gti --zoom], '', '', 42)
        expect(result.format).to_not match(%r[Stderr])
      end

      it "is included when non-empty" do
        result = described_class.new(%w[/usr/bin/gti --zoom], '', 'other stuff', 42)
        expect(result.format).to match(%r[Stderr:])
        expect(result.format).to match(%r[other stuff])
      end
    end
  end
end

Version data entries

72 entries across 72 versions & 2 rubygems

Version Path
r10k-3.15.0 spec/unit/util/subprocess/result_spec.rb
akerl-r10k-3.14.2.1 spec/unit/util/subprocess/result_spec.rb
r10k-3.14.2 spec/unit/util/subprocess/result_spec.rb
r10k-3.14.1 spec/unit/util/subprocess/result_spec.rb
r10k-3.14.0 spec/unit/util/subprocess/result_spec.rb
r10k-3.13.0 spec/unit/util/subprocess/result_spec.rb
r10k-3.12.1 spec/unit/util/subprocess/result_spec.rb
r10k-3.12.0 spec/unit/util/subprocess/result_spec.rb
r10k-3.11.0 spec/unit/util/subprocess/result_spec.rb
r10k-3.10.0 spec/unit/util/subprocess/result_spec.rb
r10k-3.9.3 spec/unit/util/subprocess/result_spec.rb
r10k-3.9.2 spec/unit/util/subprocess/result_spec.rb
r10k-3.9.1 spec/unit/util/subprocess/result_spec.rb
r10k-3.9.0 spec/unit/util/subprocess/result_spec.rb
r10k-3.8.0 spec/unit/util/subprocess/result_spec.rb
r10k-3.7.0 spec/unit/util/subprocess/result_spec.rb
r10k-3.6.0 spec/unit/util/subprocess/result_spec.rb
r10k-2.6.9 spec/unit/util/subprocess/result_spec.rb
r10k-3.5.2 spec/unit/util/subprocess/result_spec.rb
r10k-3.5.1 spec/unit/util/subprocess/result_spec.rb