Sha256: 539177075370fc2532170d5d4dee507989c735607e6bd318b1bafc077fdf6453

Contents?: true

Size: 999 Bytes

Versions: 50

Compression:

Stored size: 999 Bytes

Contents

require 'spec_helper'
require 'foreman/procfile'
require 'pathname'
require 'tmpdir'

describe Foreman::Procfile, :fakefs do
  subject { Foreman::Procfile.new }

  it "can load from a file" do
    write_procfile
    subject.load "Procfile"
    subject["alpha"].should == "./alpha"
    subject["bravo"].should == "./bravo"
  end

  it "loads a passed-in Procfile" do
    write_procfile
    procfile = Foreman::Procfile.new("Procfile")
    procfile["alpha"].should == "./alpha"
    procfile["bravo"].should == "./bravo"
  end

  it "can have a process appended to it" do
    subject["charlie"] = "./charlie"
    subject["charlie"].should == "./charlie"
  end

  it "can write to a string" do
    subject["foo"] = "./foo"
    subject["bar"] = "./bar"
    subject.to_s.should == "foo: ./foo\nbar: ./bar"
  end

  it "can write to a file" do
    subject["foo"] = "./foo"
    subject["bar"] = "./bar"
    subject.save "/tmp/proc"
    File.read("/tmp/proc").should == "foo: ./foo\nbar: ./bar\n"
  end

end

Version data entries

50 entries across 50 versions & 2 rubygems

Version Path
foreman-capistrano-0.53.4 spec/foreman/procfile_spec.rb
foreman-0.62.0-mingw32 spec/foreman/procfile_spec.rb
foreman-0.62.0-java spec/foreman/procfile_spec.rb
foreman-0.62.0 spec/foreman/procfile_spec.rb
foreman-capistrano-0.53.3 spec/foreman/procfile_spec.rb
foreman-capistrano-0.53.2 spec/foreman/procfile_spec.rb
foreman-capistrano-0.53.1 spec/foreman/procfile_spec.rb
foreman-capistrano-0.53.0 spec/foreman/procfile_spec.rb
foreman-capistrano-0.52.6 spec/foreman/procfile_spec.rb
foreman-0.61.0-mingw32 spec/foreman/procfile_spec.rb
foreman-0.61.0-java spec/foreman/procfile_spec.rb
foreman-0.61.0 spec/foreman/procfile_spec.rb
foreman-capistrano-0.52.5 spec/foreman/procfile_spec.rb
foreman-capistrano-0.52.4 spec/foreman/procfile_spec.rb
foreman-capistrano-0.52.3 spec/foreman/procfile_spec.rb
foreman-capistrano-0.52.2 spec/foreman/procfile_spec.rb
foreman-capistrano-0.52.1 spec/foreman/procfile_spec.rb
foreman-capistrano-0.52.0 spec/foreman/procfile_spec.rb
foreman-capistrano-0.51.5 spec/foreman/procfile_spec.rb
foreman-0.60.2 spec/foreman/procfile_spec.rb