Skip to content

Commit

Permalink
Lock turn version to 0.8.2 if Ruby version is 1.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
guilleiguaran committed Oct 22, 2011
1 parent ebe64f8 commit 6f7d4ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion railties/lib/rails/generators/app_base.rb
Expand Up @@ -190,10 +190,11 @@ def ruby_debugger_gemfile_entry

def turn_gemfile_entry
unless RUBY_VERSION < "1.9.2" || options[:skip_test_unit]
version = RUBY_VERSION >= "1.9.3" ? "'~> 0.8.3'" : "'0.8.2'"
<<-GEMFILE.strip_heredoc
group :test do
# Pretty printed test output
gem 'turn', :require => false
gem 'turn', #{version}, :require => false
end
GEMFILE
end
Expand Down
3 changes: 2 additions & 1 deletion railties/test/generators/app_generator_test.rb
Expand Up @@ -219,8 +219,9 @@ def test_javascript_is_skipped_if_required

def test_inclusion_of_turn_gem_in_gemfile
run_generator
version = RUBY_VERSION >= "1.9.3" ? "'~> 0.8.3'" : "'0.8.2'"
assert_file "Gemfile" do |contents|
assert_match(/gem 'turn'/, contents) unless RUBY_VERSION < '1.9.2'
assert_match(/gem 'turn', #{version}/, contents) unless RUBY_VERSION < '1.9.2'
assert_no_match(/gem 'turn'/, contents) if RUBY_VERSION < '1.9.2'
end
end
Expand Down

0 comments on commit 6f7d4ae

Please sign in to comment.