Sha256: 8f25b0ea638265a6cb696931d561b6f34150aa69ebad3de22929a3df6b59086b

Contents?: true

Size: 1.19 KB

Versions: 17

Compression:

Stored size: 1.19 KB

Contents

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

describe Foreman::Export::Bluepill, :fakefs do
  let(:procfile)  { FileUtils.mkdir_p("/tmp/app"); write_procfile("/tmp/app/Procfile") }
  let(:formation) { nil }
  let(:engine)    { Foreman::Engine.new(:formation => formation).load_procfile(procfile) }
  let(:options)   { Hash.new }
  let(:bluepill)  { Foreman::Export::Bluepill.new("/tmp/init", engine, options) }

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

  it "exports to the filesystem" do
    bluepill.export
    expect(normalize_space(File.read("/tmp/init/app.pill"))).to eq(normalize_space(example_export_file("bluepill/app.pill")))
  end

  it "cleans up if exporting into an existing dir" do
    mock(FileUtils).rm("/tmp/init/app.pill")

    bluepill.export
    bluepill.export
  end

  context "with a process formation" do
    let(:formation) { "alpha=2" }

    it "exports to the filesystem with concurrency" do
      bluepill.export
      expect(normalize_space(File.read("/tmp/init/app.pill"))).to eq(normalize_space(example_export_file("bluepill/app-concurrency.pill")))
    end
  end

end

Version data entries

17 entries across 17 versions & 3 rubygems

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