Sha256: a27c63d6acbd38e05ab7c3ab844987e9d79093efcb49ccbb3cb359792f71a7c6

Contents?: true

Size: 1.07 KB

Versions: 14

Compression:

Stored size: 1.07 KB

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"
    procfile["foo-bar"].should == "./foo-bar"
    procfile["foo_bar"].should == "./foo_bar"
  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

14 entries across 14 versions & 2 rubygems

Version Path
foreman-0.67.0-mingw32 spec/foreman/procfile_spec.rb
foreman-0.67.0-java spec/foreman/procfile_spec.rb
foreman-0.67.0 spec/foreman/procfile_spec.rb
foreman-0.66.0-mingw32 spec/foreman/procfile_spec.rb
foreman-0.66.0-java spec/foreman/procfile_spec.rb
foreman-0.66.0 spec/foreman/procfile_spec.rb
foreman-0.65.0 spec/foreman/procfile_spec.rb
foreman-0.64.0 spec/foreman/procfile_spec.rb
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/foreman-0.63.0/spec/foreman/procfile_spec.rb
mango-0.7.1 vendor/bundler/ruby/2.0.0/gems/foreman-0.63.0/spec/foreman/procfile_spec.rb
mango-0.7.0 vendor/bundler/ruby/2.0.0/gems/foreman-0.63.0/spec/foreman/procfile_spec.rb
foreman-0.63.0-mingw32 spec/foreman/procfile_spec.rb
foreman-0.63.0-java spec/foreman/procfile_spec.rb
foreman-0.63.0 spec/foreman/procfile_spec.rb