tweaked the upstart export code so that it looks for templates in ~/.foreman if no template_root is specified.

This commit is contained in:
Khaja Minhajuddin
2011-06-30 21:50:12 +05:30
parent a2ba079665
commit 8cef71766c
2 changed files with 18 additions and 0 deletions
+16
View File
@@ -36,4 +36,20 @@ describe Foreman::Export::Upstart do
File.read("/tmp/init/app.conf").should == "alternate_template\n"
end
end
context "with alternate templates from home dir" do
let(:default_template_root) {File.expand_path("~/.foreman")}
before do
FileUtils.mkdir_p default_template_root
File.open("#{default_template_root}/master.conf.erb", "w") { |f| f.puts "default_alternate_template" }
end
it "can export with alternate template files" do
upstart.export("/tmp/init")
File.read("/tmp/init/app.conf").should == "default_alternate_template\n"
end
end
end