Sha256: d9e1a3c98f22ec9dc3a0fe9c5501e91eb97d0d3995013afed004b5f4030a5c11

Contents?: true

Size: 790 Bytes

Versions: 2

Compression:

Stored size: 790 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).run_loop
      subject.start
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
foreman-0.1.1 spec/foreman/engine_spec.rb
foreman-0.1.0 spec/foreman/engine_spec.rb