aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators
diff options
context:
space:
mode:
Diffstat (limited to 'railties/test/generators')
-rw-r--r--railties/test/generators/actions_test.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/railties/test/generators/actions_test.rb b/railties/test/generators/actions_test.rb
index 0512f69f4a..5929db6318 100644
--- a/railties/test/generators/actions_test.rb
+++ b/railties/test/generators/actions_test.rb
@@ -103,6 +103,24 @@ class ActionsTest < Rails::Generators::TestCase
assert_file 'Gemfile', /gem "rspec", :only => \["development", "test"\]/
end
+ def test_gem_with_version_should_include_version_in_gemfile
+ run_generator
+
+ action :gem, 'rspec', '>=2.0.0.a5'
+
+ assert_file 'Gemfile', /gem "rspec", ">=2.0.0.a5"/
+ end
+
+ def test_gem_should_insert_on_separate_lines
+ run_generator
+
+ action :gem, 'rspec'
+ action :gem, 'rspec-rails'
+
+ assert_file 'Gemfile', /gem "rspec"$/
+ assert_file 'Gemfile', /gem "rspec-rails"$/
+ end
+
def test_environment_should_include_data_in_environment_initializer_block
run_generator
load_paths = 'config.load_paths += %w["#{Rails.root}/app/extras"]'