aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeng Siong Ong <siong1987@gmail.com>2011-05-18 10:08:34 +0800
committerTeng Siong Ong <siong1987@gmail.com>2011-05-18 10:08:34 +0800
commitea306da4eb8943dca13197ad9880df18e45a13a4 (patch)
tree3901edc5d732d6ec197a24b1c7ab508039dddef8
parent5df9d0081bd9e624a143992c4f495bf80c96d7e5 (diff)
downloadrails-ea306da4eb8943dca13197ad9880df18e45a13a4.tar.gz
rails-ea306da4eb8943dca13197ad9880df18e45a13a4.tar.bz2
rails-ea306da4eb8943dca13197ad9880df18e45a13a4.zip
add tests for ruby-debug gem in Gemfile and make sure that ruby-debug19 is used as long as RUBY_VERSION > '1.9'.
-rw-r--r--railties/lib/rails/generators/app_base.rb2
-rw-r--r--railties/test/generators/app_generator_test.rb14
2 files changed, 15 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb
index a5743762e5..cf7e57d463 100644
--- a/railties/lib/rails/generators/app_base.rb
+++ b/railties/lib/rails/generators/app_base.rb
@@ -165,7 +165,7 @@ module Rails
end
def gem_for_ruby_debugger
- if RUBY_VERSION < "1.9.2"
+ if RUBY_VERSION < "1.9"
"gem 'ruby-debug'"
else
"gem 'ruby-debug19', :require => 'ruby-debug'"
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index 8c89c06e02..c1912c23b8 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -210,6 +210,20 @@ class AppGeneratorTest < Rails::Generators::TestCase
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"])