Sha256: d041a7b838752245aa9753c29e2b2aa5c874dc5e183185f1a39711433603f97a

Contents?: true

Size: 1.52 KB

Versions: 12

Compression:

Stored size: 1.52 KB

Contents

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

describe Foreman::Export::Runit do
  let(:procfile) { FileUtils.mkdir_p("/tmp/app"); write_procfile("/tmp/app/Procfile", 'bar=baz') }
  let(:engine) { Foreman::Engine.new(procfile) }
  let(:runit) { Foreman::Export::Runit.new(engine) }
  
  before(:each) { load_export_templates_into_fakefs("runit") }
  before(:each) { stub(runit).say }
  
  it "exports to the filesystem" do
    FileUtils.mkdir_p('/tmp/init')
    runit.export('/tmp/init', :concurrency => 'alpha=2')
    
    File.read("/tmp/init/app-alpha-1/run").should == example_export_file('runit/app-alpha-1-run')
    File.read("/tmp/init/app-alpha-1/log/run").should == 
        example_export_file('runit/app-alpha-1-log-run')
    File.read("/tmp/init/app-alpha-1/env/PORT").should == "5000\n"
    File.read("/tmp/init/app-alpha-1/env/BAR").should == "baz\n"
    
    File.read("/tmp/init/app-alpha-2/run").should == example_export_file('runit/app-alpha-2-run')
    File.read("/tmp/init/app-alpha-2/log/run").should == 
        example_export_file('runit/app-alpha-2-log-run')
    File.read("/tmp/init/app-alpha-2/env/PORT").should == "5001\n"
    File.read("/tmp/init/app-alpha-2/env/BAR").should == "baz\n"
    
    File.read("/tmp/init/app-bravo-1/run").should == example_export_file('runit/app-bravo-1-run')
    File.read("/tmp/init/app-bravo-1/log/run").should == 
        example_export_file('runit/app-bravo-1-log-run')
    File.read("/tmp/init/app-bravo-1/env/PORT").should == "5100\n"
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
foreman-0.33.1 spec/foreman/export/runit_spec.rb
foreman-0.33.0 spec/foreman/export/runit_spec.rb
foreman-0.32.0 spec/foreman/export/runit_spec.rb
foreman-0.31.0 spec/foreman/export/runit_spec.rb
foreman-0.30.1 spec/foreman/export/runit_spec.rb
foreman-0.30.0 spec/foreman/export/runit_spec.rb
foreman-0.29.0 spec/foreman/export/runit_spec.rb
foreman-0.28.0.pre2 spec/foreman/export/runit_spec.rb
foreman-0.28.0.pre1 spec/foreman/export/runit_spec.rb
foreman-0.27.0 spec/foreman/export/runit_spec.rb
foreman-0.26.1 spec/foreman/export/runit_spec.rb
foreman-0.26.0 spec/foreman/export/runit_spec.rb