1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00

Merge pull request #786 from rubyzg/master

override default rake application name
This commit is contained in:
Tom Clements 2013-11-22 04:59:32 -08:00
commit f9c87c0c9f
3 changed files with 7 additions and 7 deletions

1
.gitignore vendored
View file

@ -18,3 +18,4 @@ tmp
.rspec-local
.ruby-version
_site
.rspec

View file

@ -3,10 +3,13 @@ module Capistrano
def initialize
super
@name = "cap"
@rakefiles = %w{capfile Capfile capfile.rb Capfile.rb} << capfile
end
def name
"cap"
end
def run
Rake.application = self
super
@ -18,7 +21,6 @@ module Capistrano
end
def load_rakefile
@name = 'cap'
super
end

View file

@ -7,11 +7,10 @@ describe Capistrano::Application do
it "provides a --format option which enables the choice of output formatting"
it "identifies itself as cap and not rake" do
pending "Waiting for: https://github.com/jimweirich/rake/pull/204"
out, _ = capture_io do
flags '--help', '-h'
end
out.should match(/\bcap [ -f capfile ]\b/)
out.lines.first.should match(/cap \[-f rakefile\]/)
end
it "overrides the rake method, but still prints the rake version" do
@ -37,9 +36,7 @@ describe Capistrano::Application do
def subject.exit(*args)
throw(:system_exit, :exit)
end
subject.instance_eval do
handle_options
end
subject.run
subject.options
end