Sha256: 3b0930b4af2b8dd6c3b0bd2f041d0e4688633019832620c3e8910de575498153

Contents?: true

Size: 1.11 KB

Versions: 17

Compression:

Stored size: 1.11 KB

Contents

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

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

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

  it "exports to the filesystem" do
    launchd.export
    expect(File.read("/tmp/init/app-alpha-1.plist")).to eq(example_export_file("launchd/launchd-a.default"))
    expect(File.read("/tmp/init/app-bravo-1.plist")).to eq(example_export_file("launchd/launchd-b.default"))
  end

  context "with multiple command arguments" do
    let(:procfile) { FileUtils.mkdir_p("/tmp/app"); write_procfile("/tmp/app/Procfile", "charlie") }

    it "splits each command argument" do
      launchd.export
      expect(File.read("/tmp/init/app-alpha-1.plist")).to eq(example_export_file("launchd/launchd-c.default"))
    end

  end

end

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
ypadlyak-foreman-0.81.0 spec/foreman/export/launchd_spec.rb
foreman-systemd-0.78.0 spec/foreman/export/launchd_spec.rb
foreman-0.82.0 spec/foreman/export/launchd_spec.rb
foreman-0.81.0 spec/foreman/export/launchd_spec.rb
foreman-0.80.2 spec/foreman/export/launchd_spec.rb
foreman-0.80.1 spec/foreman/export/launchd_spec.rb
foreman-0.80.0 spec/foreman/export/launchd_spec.rb
foreman-0.78.0 spec/foreman/export/launchd_spec.rb
foreman-0.77.0 spec/foreman/export/launchd_spec.rb
foreman-0.76.0 spec/foreman/export/launchd_spec.rb
foreman-0.75.0 spec/foreman/export/launchd_spec.rb
foreman-0.74.0 spec/foreman/export/launchd_spec.rb
foreman-0.73.0 spec/foreman/export/launchd_spec.rb
foreman-0.71.0 spec/foreman/export/launchd_spec.rb
foreman-0.70.0 spec/foreman/export/launchd_spec.rb
foreman-0.69.0-mingw32 spec/foreman/export/launchd_spec.rb
foreman-0.69.0 spec/foreman/export/launchd_spec.rb