Sha256: ba1a68ee3b6de4cabfa3466c69b31bcc8bccb146cf604f31832717647ac84e31

Contents?: true

Size: 1.17 KB

Versions: 64

Compression:

Stored size: 1.17 KB

Contents

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

describe Foreman::Export::Inittab, :fakefs do
  let(:procfile)  { FileUtils.mkdir_p("/tmp/app"); write_procfile("/tmp/app/Procfile") }
  let(:location)  { "/tmp/inittab" }
  let(:formation) { nil }
  let(:engine)    { Foreman::Engine.new(:formation => formation).load_procfile(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(:formation) { "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

64 entries across 64 versions & 3 rubygems

Version Path
foreman-0.67.0-mingw32 spec/foreman/export/inittab_spec.rb
foreman-0.67.0-java spec/foreman/export/inittab_spec.rb
foreman-0.67.0 spec/foreman/export/inittab_spec.rb
foreman-0.66.0-mingw32 spec/foreman/export/inittab_spec.rb
foreman-0.66.0-java spec/foreman/export/inittab_spec.rb
foreman-0.66.0 spec/foreman/export/inittab_spec.rb
foreman-0.65.0 spec/foreman/export/inittab_spec.rb
foreman-0.64.0 spec/foreman/export/inittab_spec.rb
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/foreman-0.63.0/spec/foreman/export/inittab_spec.rb
mango-0.7.1 vendor/bundler/ruby/2.0.0/gems/foreman-0.63.0/spec/foreman/export/inittab_spec.rb
mango-0.7.0 vendor/bundler/ruby/2.0.0/gems/foreman-0.63.0/spec/foreman/export/inittab_spec.rb
foreman-capistrano-0.53.4 spec/foreman/export/inittab_spec.rb
foreman-0.63.0-mingw32 spec/foreman/export/inittab_spec.rb
foreman-0.63.0-java spec/foreman/export/inittab_spec.rb
foreman-0.63.0 spec/foreman/export/inittab_spec.rb
foreman-0.62.0-mingw32 spec/foreman/export/inittab_spec.rb
foreman-0.62.0-java spec/foreman/export/inittab_spec.rb
foreman-0.62.0 spec/foreman/export/inittab_spec.rb
foreman-capistrano-0.53.3 spec/foreman/export/inittab_spec.rb
foreman-capistrano-0.53.2 spec/foreman/export/inittab_spec.rb