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