aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2014-08-07 16:10:20 -0700
committerDavid Heinemeier Hansson <david@loudthinking.com>2014-08-07 16:10:20 -0700
commit089661b69ad055cab68ea860c085c7f852da3972 (patch)
treea39fe35f3c399b199bdca8490724b451761a1cba /railties/test/generators
parentcc1de71bfaced172fe00a66fd381da69d9528e8b (diff)
parente81453ef92b37156dafc092093106c8e8b87b268 (diff)
downloadrails-089661b69ad055cab68ea860c085c7f852da3972.tar.gz
rails-089661b69ad055cab68ea860c085c7f852da3972.tar.bz2
rails-089661b69ad055cab68ea860c085c7f852da3972.zip
Merge branch 'master' of github.com:rails/rails
Diffstat (limited to 'railties/test/generators')
-rw-r--r--railties/test/generators/app_generator_test.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index 184cfc2220..3f31f89473 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -501,6 +501,21 @@ class AppGeneratorTest < Rails::Generators::TestCase
end
end
+ def test_after_bundle_callback
+ path = 'http://example.org/rails_template'
+ template = %{ after_bundle { run 'echo ran after_bundle' } }
+ template.instance_eval "def read; self; end" # Make the string respond to read
+
+ generator([destination_root], template: path).expects(:open).with(path, 'Accept' => 'application/x-thor-template').returns(template)
+
+ bundler_first = sequence('bundle, binstubs, after_bundle')
+ generator.expects(:bundle_command).with('install').once.in_sequence(bundler_first)
+ generator.expects(:bundle_command).with('exec spring binstub --all').in_sequence(bundler_first)
+ generator.expects(:run).with('echo ran after_bundle').in_sequence(bundler_first)
+
+ quietly { generator.invoke_all }
+ end
+
protected
def action(*args, &block)