mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #1112 from FLOChip/turn
add test case for turn gem for testunit.
This commit is contained in:
commit
2692d3278a
2 changed files with 31 additions and 2 deletions
|
@ -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'"
|
||||
|
@ -173,7 +173,7 @@ module Rails
|
|||
end
|
||||
|
||||
def gem_for_turn
|
||||
unless RUBY_VERSION < "1.9.2"
|
||||
unless RUBY_VERSION < "1.9.2" || options[:skip_test_unit]
|
||||
<<-GEMFILE.strip_heredoc
|
||||
group :test do
|
||||
# Pretty printed test output
|
||||
|
|
|
@ -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"])
|
||||
|
|
Loading…
Reference in a new issue