From 47bc5d0cc8dec79c0c64ade7d453b60f846424a9 Mon Sep 17 00:00:00 2001 From: Wojciech Mach Date: Sun, 4 Sep 2011 10:14:53 +0200 Subject: Add gem_group support to generators --- railties/test/generators/actions_test.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'railties/test/generators') diff --git a/railties/test/generators/actions_test.rb b/railties/test/generators/actions_test.rb index 56cb53c1ad..94e9abb3cc 100644 --- a/railties/test/generators/actions_test.rb +++ b/railties/test/generators/actions_test.rb @@ -102,6 +102,20 @@ class ActionsTest < Rails::Generators::TestCase assert_file 'Gemfile', /gem "rspec-rails"$/ end + def test_gem_group_should_wrap_gems_in_a_group + run_generator + + action :gem_group, :development, :test do + gem 'rspec-rails' + end + + action :gem_group, :test do + gem 'fakeweb' + end + + assert_file 'Gemfile', /\ngroup :development, :test do\n gem "rspec-rails"\nend\n\ngroup :test do\n gem "fakeweb"\nend/ + end + def test_environment_should_include_data_in_environment_initializer_block run_generator autoload_paths = 'config.autoload_paths += %w["#{Rails.root}/app/extras"]' -- cgit v1.2.3