diff options
author | Jon Leighton <j@jonathanleighton.com> | 2013-11-02 18:25:02 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2013-12-03 23:07:40 +0000 |
commit | df50e3064abc3099adc524f381ffced0dab84869 (patch) | |
tree | 09b021abbcadd4beccc90eb7fd52f93ea2582f88 /railties/test/generators/app_generator_test.rb | |
parent | d5332de37963ab41372541fc8cf66f602663abf4 (diff) | |
download | rails-df50e3064abc3099adc524f381ffced0dab84869.tar.gz rails-df50e3064abc3099adc524f381ffced0dab84869.tar.bz2 rails-df50e3064abc3099adc524f381ffced0dab84869.zip |
Install Spring preloader when generating new applications
Diffstat (limited to 'railties/test/generators/app_generator_test.rb')
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index 257d07f514..7c2040470f 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -437,6 +437,34 @@ class AppGeneratorTest < Rails::Generators::TestCase assert_file "foo bar/config/initializers/session_store.rb", /key: '_foo_bar/ end + def test_spring + run_generator + assert_file "Gemfile", /gem 'spring'/ + end + + def test_spring_binstubs + generator.stubs(:bundle_command).with('install') + generator.expects(:bundle_command).with('exec spring binstub --all').once + quietly { generator.invoke_all } + end + + def test_spring_no_fork + Process.stubs(:respond_to?).with(:fork).returns(false) + run_generator + + assert_file "Gemfile" do |content| + assert_no_match(/spring/, content) + end + end + + def test_skip_spring + run_generator [destination_root, "--skip-spring"] + + assert_file "Gemfile" do |content| + assert_no_match(/spring/, content) + end + end + protected def action(*args, &block) |