Sha256: a622c818df1baee8e6e43d15df464e53cafdbd5ca4e5e67ea9be795c7ef1d253
Contents?: true
Size: 1.35 KB
Versions: 6
Compression:
Stored size: 1.35 KB
Contents
require "spec_helper" require "foreman/engine" describe "Foreman::Engine" do subject { Foreman::Engine.new("Procfile") } describe "initialize" do describe "without an existing Procfile" do it "raises an error" do lambda { subject }.should raise_error end end describe "with a Procfile" do it "reads the processes" do write_procfile subject.processes["alpha"].command.should == "./alpha" subject.processes["bravo"].command.should == "./bravo" end end end describe "start" do it "forks the processes" do write_procfile mock(subject).fork(subject.processes["alpha"], {}) mock(subject).fork(subject.processes["bravo"], {}) mock(subject).watch_for_termination subject.start end it "handles concurrency" do write_procfile mock(subject).fork_individual(subject.processes["alpha"], 5000) mock(subject).fork_individual(subject.processes["alpha"], 5001) mock(subject).fork_individual(subject.processes["bravo"], 5100) mock(subject).watch_for_termination subject.start(:concurrency => "alpha=2") end end describe "execute" do it "runs the processes" do write_procfile mock(subject).fork(subject.processes["alpha"], {}) mock(subject).watch_for_termination subject.execute("alpha") end end end
Version data entries
6 entries across 6 versions & 1 rubygems