Skip to content

Commit

Permalink
Test that invalid Procfile entries are ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinlitchfield committed Jun 16, 2017
1 parent d80b759 commit 26fddc2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/foreman/procfile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
expect(procfile["foo_bar"]).to eq("./foo_bar")
end

it 'only creates Procfile entries for lines matching regex' do
write_procfile
procfile = Foreman::Procfile.new("Procfile")
keys = procfile.instance_variable_get(:@entries).map(&:first)
expect(keys).to match_array(%w[alpha bravo foo-bar foo_bar])
end

it "returns nil when attempting to retrieve an non-existing entry" do
write_procfile
procfile = Foreman::Procfile.new("Procfile")
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def write_procfile(procfile="Procfile", alpha_env="")
file.puts "bravo:\t./bravo"
file.puts "foo_bar:\t./foo_bar"
file.puts "foo-bar:\t./foo-bar"
file.puts "# baz:\t./baz"
end
File.expand_path(procfile)
end
Expand Down

0 comments on commit 26fddc2

Please sign in to comment.