add tests for ruby-debug gem in Gemfile and make sure that ruby-debug19 is used as long as RUBY_VERSION > '1.9'.

This commit is contained in:
Teng Siong Ong 2011-05-18 10:08:34 +08:00
parent 5df9d0081b
commit ea306da4eb
2 changed files with 15 additions and 1 deletions

@ -165,7 +165,7 @@ def gem_for_database
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'"

@ -210,6 +210,20 @@ def test_inclusion_of_turn_gem_in_gemfile
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"])