diff options
author | Yves Senn <yves.senn@gmail.com> | 2014-08-06 08:49:00 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2014-08-06 08:49:00 +0200 |
commit | a8192119840c62bf2a0e564817c172191711b4b2 (patch) | |
tree | 432ae673ce2a219796a634f5769b151f1c0a3af4 /railties/test/generators | |
parent | ec54acd1e01374f0b5b495d7659181d7382e119e (diff) | |
parent | c294e91d00696e910e05ad1428ba3ce4884bc6a3 (diff) | |
download | rails-a8192119840c62bf2a0e564817c172191711b4b2.tar.gz rails-a8192119840c62bf2a0e564817c172191711b4b2.tar.bz2 rails-a8192119840c62bf2a0e564817c172191711b4b2.zip |
Merge pull request #16359 from skanev/after-bundle-in-rails-templates
Add an after_bundle callback in Rails templates
Conflicts:
railties/CHANGELOG.md
Diffstat (limited to 'railties/test/generators')
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 15 |
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) |