Skip to content
Browse files

Simplified --heroku option, Test still needs fixing

Signed-off-by: Vann Ek <vann@innerfusion.net>
  • Loading branch information...
1 parent e690045 commit 9de3a9c8eddde295a8f1bde775dc813af457ba70 @citizen428 citizen428 committed with Mar 25, 2009
Showing with 4 additions and 4 deletions.
  1. +2 −2 app_generators/sinatra_app/sinatra_app_generator.rb
  2. +2 −2 test/test_sinatra_app_generator.rb
View
4 app_generators/sinatra_app/sinatra_app_generator.rb
@@ -40,7 +40,7 @@ def manifest
if heroku
m.run("#{git} init")
- m.run("heroku create #{heroku}")
+ m.run("heroku create #{app_name}")
end
m.template 'config.ru.erb', 'config.ru'
@@ -97,7 +97,7 @@ def add_options!(opts)
opts.on("-d", "--vendor", "Extract the latest sinatra to vendor/sinatra") {|o| options[:vendor] = o }
opts.on("--tiny", "Only create the minimal files.") {|o| options[:tiny] = o }
opts.on("--init", "Initialize a git repository") {|o| options[:init] = o }
- opts.on("--heroku=app_name", "Creates a Heroku app (also does 'git init')") { |o| options[:heroku] = o }
+ opts.on("--heroku", "Creates app on Heroku (also does 'git init')") { |o| options[:heroku] = o }
opts.on("--cap", "Adds config directory with basic capistrano deploy.rb") {|o| options[:cap] = o }
opts.on("--scripts", "Install the rubigen scripts (script/generate, script/destroy)") {|o| options[:scripts] = o }
opts.on("--git /path/to/git", "Specify a different path for 'git'") {|o| options[:git] = o }
View
4 test/test_sinatra_app_generator.rb
@@ -41,11 +41,11 @@ def test_generate_app_with_init_option
end
def test_generate_app_with_heroku_option
- run_generator('sinatra_app', [APP_ROOT, "--heroku=#{Time.now.strftime("%Y%m%d_%H%M")+'test'}"], sources)
+ run_generator('sinatra_app', [APP_ROOT, '--heroku'], sources)
assert_basic_paths_and_files
assert_directory_exists '.git'
assert_generated_file '.git/config' do |config_contents|
- assert_match(/[remote "heroku"]/, config_contents)
+ assert_match(/\[remote "heroku"\]/, config_contents)
end
end

0 comments on commit 9de3a9c

Please sign in to comment.
Something went wrong with that request. Please try again.