aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators/actions_test.rb
diff options
context:
space:
mode:
authorWill Fisher <will@gina.alaska.edu>2015-12-18 17:54:54 -0900
committerWill Fisher <will@gina.alaska.edu>2015-12-21 06:06:30 -0900
commit12dd2ca86397794a0b07c4c775fded7010a20e7e (patch)
tree3dcec91688f3499db4940d7bcbe16e0bef1c31b8 /railties/test/generators/actions_test.rb
parent0af3722335795c6b7c0ff557d229e47566dfbed2 (diff)
downloadrails-12dd2ca86397794a0b07c4c775fded7010a20e7e.tar.gz
rails-12dd2ca86397794a0b07c4c775fded7010a20e7e.tar.bz2
rails-12dd2ca86397794a0b07c4c775fded7010a20e7e.zip
Fixes using `add_source` with a block after using `gem` in a custom rails
generator template.
Diffstat (limited to 'railties/test/generators/actions_test.rb')
-rw-r--r--railties/test/generators/actions_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/railties/test/generators/actions_test.rb b/railties/test/generators/actions_test.rb
index 2f42ce894b..a1a17d90d8 100644
--- a/railties/test/generators/actions_test.rb
+++ b/railties/test/generators/actions_test.rb
@@ -52,6 +52,15 @@ class ActionsTest < Rails::Generators::TestCase
assert_file 'Gemfile', /source 'http:\/\/gems\.github\.com' do\n gem 'rspec-rails'\nend/
end
+ def test_add_source_with_block_adds_source_to_gemfile_after_gem
+ run_generator
+ action :gem, 'will-paginate'
+ action :add_source, 'http://gems.github.com' do
+ gem 'rspec-rails'
+ end
+ assert_file 'Gemfile', /gem 'will-paginate'\nsource 'http:\/\/gems\.github\.com' do\n gem 'rspec-rails'\nend/
+ end
+
def test_gem_should_put_gem_dependency_in_gemfile
run_generator
action :gem, 'will-paginate'