Sha256: 01b349bc710820267d377a24386e57dff635e5af1598135d0b4b090349fc6169

Contents?: true

Size: 984 Bytes

Versions: 13

Compression:

Stored size: 984 Bytes

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
  end

  describe "execute" do
    it "runs the processes" do
      write_procfile
      mock(subject).run(subject.processes["alpha"], false)
      subject.execute("alpha")
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
foreman-0.6.0 spec/foreman/engine_spec.rb
foreman-0.5.1 spec/foreman/engine_spec.rb
foreman-0.5.0 spec/foreman/engine_spec.rb
foreman-0.4.7 spec/foreman/engine_spec.rb
foreman-0.4.6 spec/foreman/engine_spec.rb
foreman-0.4.5 spec/foreman/engine_spec.rb
foreman-0.4.4 spec/foreman/engine_spec.rb
foreman-0.4.3 spec/foreman/engine_spec.rb
foreman-0.4.2 spec/foreman/engine_spec.rb
foreman-0.4.1 spec/foreman/engine_spec.rb
foreman-0.3.2 spec/foreman/engine_spec.rb
foreman-0.3.1 spec/foreman/engine_spec.rb
foreman-0.3.0 spec/foreman/engine_spec.rb