Permalink
Browse files

push: use given command even if Procfile exists

[finishes #45887129]
  • Loading branch information...
1 parent 23027e9 commit 317a7cfc73ea3c023aa9f2251316838a72efc6c3 Alex Suraci & Chris Brown committed Mar 11, 2013
Showing with 23 additions and 1 deletion.
  1. +1 −1 lib/vmc/cli/app/push/create.rb
  2. +22 −0 spec/vmc/cli/app/push/create_spec.rb
@@ -13,7 +13,7 @@ def get_inputs
if v2?
inputs[:production] = !!(input[:plan] =~ /^p/i)
- inputs[:command] = input[:command] unless has_procfile?
+ inputs[:command] = input[:command] if input.has?(:command) || !has_procfile?
framework = detector.detect_framework
else
@@ -65,6 +65,28 @@
its([:buildpack]) { should eq "git://example.com" }
end
+ context 'when the command is given' do
+ context "and there is a Procfile in the application's root" do
+ before do
+ FakeFS.activate!
+ Dir.mkdir(path)
+
+ # fakefs removes fnmatch :'(
+ stub(create.send(:detector)).detect_framework
+ File.open("#{path}/Procfile", "w") do |file|
+ file.write("this is a procfile")
+ end
+ end
+
+ after do
+ FakeFS.deactivate!
+ FakeFS::FileSystem.clear
+ end
+
+ its([:command]) { should eq "ruby main.rb" }
+ end
+ end
+
context 'when certain inputs are not given' do
it 'asks for the name' do
inputs.delete(:name)

0 comments on commit 317a7cf

Please sign in to comment.