aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-05-17 21:44:21 -0700
committerJosé Valim <jose.valim@gmail.com>2011-05-17 21:44:21 -0700
commit2692d3278a7b15699491f8c86b4180eaad9ce196 (patch)
tree480baaefd8ae164b0268507bbab4624ab91a037b /railties/test
parentc2105d3b2099324bb003df7a53a2b146236a7a4e (diff)
parentda29e0bfc2fa83efaf12c9ad31f4b5005178c8a5 (diff)
downloadrails-2692d3278a7b15699491f8c86b4180eaad9ce196.tar.gz
rails-2692d3278a7b15699491f8c86b4180eaad9ce196.tar.bz2
rails-2692d3278a7b15699491f8c86b4180eaad9ce196.zip
Merge pull request #1112 from FLOChip/turn
add test case for turn gem for testunit.
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/generators/app_generator_test.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index 9e1d47cd2f..80d9732343 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -202,6 +202,35 @@ class AppGeneratorTest < Rails::Generators::TestCase
end
end
+ def test_inclusion_of_turn_gem_in_gemfile
+ run_generator
+ assert_file "Gemfile" do |contents|
+ assert_match /gem 'turn'/, contents unless RUBY_VERSION < '1.9.2'
+ assert_no_match /gem 'turn'/, contents if RUBY_VERSION < '1.9.2'
+ end
+ end
+
+ def test_turn_gem_is_not_included_in_gemfile_if_skipping_test_unit
+ run_generator [destination_root, "--skip-test-unit"]
+ assert_file "Gemfile" do |contents|
+ assert_no_match /gem 'tuarn'/, contents unless RUBY_VERSION < '1.9.2'
+ end
+ end
+
+ def test_inclusion_of_ruby_debug
+ run_generator
+ assert_file "Gemfile" do |contents|
+ assert_match /gem 'ruby-debug'/, contents if RUBY_VERSION < '1.9'
+ end
+ end
+
+ def test_inclusion_of_ruby_debug19_if_ruby19
+ run_generator
+ assert_file "Gemfile" do |contents|
+ assert_match /gem 'ruby-debug19', :require => 'ruby-debug'/, contents unless RUBY_VERSION < '1.9'
+ end
+ end
+
def test_template_from_dir_pwd
FileUtils.cd(Rails.root)
assert_match /It works from file!/, run_generator([destination_root, "-m", "lib/template.rb"])