diff --git a/.gitignore b/.gitignore index 700d338f..131db7ec 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ tmp .rspec-local .ruby-version _site +.rspec diff --git a/lib/capistrano/application.rb b/lib/capistrano/application.rb index bf91f709..7fc9905c 100644 --- a/lib/capistrano/application.rb +++ b/lib/capistrano/application.rb @@ -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 diff --git a/spec/lib/capistrano/application_spec.rb b/spec/lib/capistrano/application_spec.rb index 7c0d593c..9c2ecfba 100644 --- a/spec/lib/capistrano/application_spec.rb +++ b/spec/lib/capistrano/application_spec.rb @@ -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