Sha256: fc25e283e3b8ed9c13240610cdba0640666647c8084a8cb22c0b684556a08df4

Contents?: true

Size: 1.15 KB

Versions: 33

Compression:

Stored size: 1.15 KB

Contents

require "spec_helper"
require "foreman/engine"
require "foreman/export/inittab"
require "tmpdir"

describe Foreman::Export::Inittab, :fakefs do
  let(:location) { "/tmp/inittab" }
  let(:procfile) { FileUtils.mkdir_p("/tmp/app"); write_procfile("/tmp/app/Procfile") }
  let(:location) { "/tmp/inittab" }
  let(:engine)   { Foreman::Engine.new(procfile) }
  let(:options)  { Hash.new }
  let(:inittab)  { Foreman::Export::Inittab.new(location, engine, options) }

  before(:each) { load_export_templates_into_fakefs("inittab") }
  before(:each) { stub(inittab).say }

  it "exports to the filesystem" do
    inittab.export
    File.read("/tmp/inittab").should == example_export_file("inittab/inittab.default")
  end

  context "to stdout" do
    let(:location) { "-" }

    it "exports to stdout" do
      mock(inittab).puts example_export_file("inittab/inittab.default")
      inittab.export
    end
  end

  context "with concurrency" do
    let(:options) { Hash[:concurrency => "alpha=2"] }

    it "exports to the filesystem with concurrency" do
      inittab.export
      File.read("/tmp/inittab").should == example_export_file("inittab/inittab.concurrency")
    end
  end

end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
foreman-0.39.0 spec/foreman/export/inittab_spec.rb
foreman-0.38.0-mingw32 spec/foreman/export/inittab_spec.rb
foreman-0.38.0-java spec/foreman/export/inittab_spec.rb
foreman-0.38.0 spec/foreman/export/inittab_spec.rb
foreman-0.37.2-mingw32 spec/foreman/export/inittab_spec.rb
foreman-0.37.2-java spec/foreman/export/inittab_spec.rb
foreman-0.37.2 spec/foreman/export/inittab_spec.rb
foreman-0.37.1-mingw32 spec/foreman/export/inittab_spec.rb
foreman-0.37.1-java spec/foreman/export/inittab_spec.rb
foreman-0.37.1 spec/foreman/export/inittab_spec.rb
foreman-0.37.0-mingw32 spec/foreman/export/inittab_spec.rb
foreman-0.37.0-java spec/foreman/export/inittab_spec.rb
foreman-0.37.0 spec/foreman/export/inittab_spec.rb