aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators
diff options
context:
space:
mode:
authorCaio Chassot <dev@caiochassot.com>2010-02-22 04:09:51 -0300
committerJosé Valim <jose.valim@gmail.com>2010-03-12 21:33:39 +0100
commit94a60a5600269a9ce63eb8991c4deaa26cd0a7b6 (patch)
treeb6ec5d8e2244783f50995507aa40cb47132a300f /railties/test/generators
parent9268b598bb20523e1b886f8811598647ce427ef9 (diff)
downloadrails-94a60a5600269a9ce63eb8991c4deaa26cd0a7b6.tar.gz
rails-94a60a5600269a9ce63eb8991c4deaa26cd0a7b6.tar.bz2
rails-94a60a5600269a9ce63eb8991c4deaa26cd0a7b6.zip
In app_generator, fix hardcoded `bundle` call to derive the bundle executable name from Thor::Util.ruby_command.
This ensures that eg. when `rails` is called from `ruby1.9`, `bundle1.9` is called. Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'railties/test/generators')
-rw-r--r--railties/test/generators/app_generator_test.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index 1303adfaab..4fc26563ff 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -9,6 +9,7 @@ class AppGeneratorTest < Rails::Generators::TestCase
def setup
super
Rails::Generators::AppGenerator.instance_variable_set('@desc', nil)
+ @bundle_command = File.basename(Thor::Util.ruby_command).sub(/ruby/, 'bundle')
end
def teardown
@@ -168,14 +169,14 @@ class AppGeneratorTest < Rails::Generators::TestCase
end
def test_dev_option
- generator([destination_root], :dev => true).expects(:run).with("bundle install")
+ generator([destination_root], :dev => true).expects(:run).with("#{@bundle_command} install")
silence(:stdout){ generator.invoke }
rails_path = File.expand_path('../../..', Rails.root)
assert_file 'Gemfile', /^gem\s+["']rails["'],\s+:path\s+=>\s+["']#{Regexp.escape(rails_path)}["']$/
end
def test_edge_option
- generator([destination_root], :edge => true).expects(:run).with("bundle install")
+ generator([destination_root], :edge => true).expects(:run).with("#{@bundle_command} install")
silence(:stdout){ generator.invoke }
assert_file 'Gemfile', /^gem\s+["']rails["'],\s+:git\s+=>\s+["']#{Regexp.escape("git://github.com/rails/rails.git")}["']$/
end