Moved Turn activation/dependency to railties

This commit is contained in:
David Heinemeier Hansson 2011-03-31 16:20:59 -07:00
parent caf0a72c85
commit 0eb6e5e270
8 changed files with 12 additions and 38 deletions

View File

@ -1,7 +1,5 @@
*Rails 3.1.0 (unreleased)* *Rails 3.1.0 (unreleased)*
* Add using Turn with natural language test case names if the library is available (which it will be in Rails 3.1) [DHH]
* LocalCache strategy is now a real middleware class, not an anonymous class * LocalCache strategy is now a real middleware class, not an anonymous class
posing for pictures. posing for pictures.

View File

@ -5,7 +5,6 @@ require 'active_support/testing/deprecation'
require 'active_support/testing/declarative' require 'active_support/testing/declarative'
require 'active_support/testing/pending' require 'active_support/testing/pending'
require 'active_support/testing/isolation' require 'active_support/testing/isolation'
require 'active_support/testing/turn_formatting'
require 'active_support/testing/mochaing' require 'active_support/testing/mochaing'
require 'active_support/core_ext/kernel/reporting' require 'active_support/core_ext/kernel/reporting'

View File

@ -1,33 +0,0 @@
# Turn gives you prettier formatting for MiniTest and inline failure reporting.
# It also allows us to report test cases in natural language rather than with underscores. Example:
#
# CommentsControllerTest:
# PASS the truth (0.03s)
#
# APITest
# test_api_without_subdomain PASS
# test_create_milestone_using_typed_xml FAIL
# /test/integration/api_test.rb:50:in `test_create_milestone_using_typed_xml'
# <2006-05-01> expected but was
# <Mon May 01 07:00:00 UTC 2006>.
# test_create_milestone_using_untyped_xml FAIL
# /test/integration/api_test.rb:38:in `test_create_milestone_using_untyped_xml'
# <2006-05-01> expected but was
# <Mon May 01 07:00:00 UTC 2006>.
#
# vs:
#
# .FF
if defined?(MiniTest)
begin
silence_warnings { require 'turn' }
if MiniTest::Unit.respond_to?(:use_natural_language_case_names=)
MiniTest::Unit.use_natural_language_case_names = true
end
rescue LoadError
# If there's no turn, that's fine, it's just formatting
end
end

View File

@ -25,6 +25,5 @@ Gem::Specification.new do |s|
s.add_dependency('activeresource', version) s.add_dependency('activeresource', version)
s.add_dependency('actionmailer', version) s.add_dependency('actionmailer', version)
s.add_dependency('railties', version) s.add_dependency('railties', version)
s.add_dependency('turn', '~> 0.8.2')
s.add_dependency('bundler', '~> 1.0') s.add_dependency('bundler', '~> 1.0')
end end

View File

@ -1,5 +1,7 @@
*Rails 3.1.0 (unreleased)* *Rails 3.1.0 (unreleased)*
* Add using Turn with natural language test case names for test_help.rb when running with minitest (Ruby 1.9.2+) [DHH]
* Direct logging of Active Record to STDOUT so it's shown inline with the results in the console [DHH] * Direct logging of Active Record to STDOUT so it's shown inline with the results in the console [DHH]
* Added `config.force_ssl` configuration which loads Rack::SSL middleware and force all requests to be under HTTPS protocol [DHH, Prem Sichanugrist, and Josh Peek] * Added `config.force_ssl` configuration which loads Rack::SSL middleware and force all requests to be under HTTPS protocol [DHH, Prem Sichanugrist, and Josh Peek]

View File

@ -36,7 +36,7 @@ module Rails
end end
if defined?(ActiveRecord) if defined?(ActiveRecord)
ActiveRecord::Base.logger = Logger.new(STDOUT) ActiveRecord::Base.logger = Logger.new(STDERR)
end end
if options[:sandbox] if options[:sandbox]

View File

@ -13,6 +13,14 @@ if defined?(Test::Unit::Util::BacktraceFilter) && ENV['BACKTRACE'].nil?
Test::Unit::Util::BacktraceFilter.module_eval { include Rails::BacktraceFilterForTestUnit } Test::Unit::Util::BacktraceFilter.module_eval { include Rails::BacktraceFilterForTestUnit }
end end
if defined?(MiniTest)
require 'turn'
if MiniTest::Unit.respond_to?(:use_natural_language_case_names=)
MiniTest::Unit.use_natural_language_case_names = true
end
end
if defined?(ActiveRecord) if defined?(ActiveRecord)
require 'active_record/test_case' require 'active_record/test_case'

View File

@ -22,6 +22,7 @@ Gem::Specification.new do |s|
s.add_dependency('rake', '>= 0.8.7') s.add_dependency('rake', '>= 0.8.7')
s.add_dependency('thor', '~> 0.14.4') s.add_dependency('thor', '~> 0.14.4')
s.add_dependency('rack-ssl', '~> 1.3.2') s.add_dependency('rack-ssl', '~> 1.3.2')
s.add_dependency('turn', '~> 0.8.2')
s.add_dependency('activesupport', version) s.add_dependency('activesupport', version)
s.add_dependency('actionpack', version) s.add_dependency('actionpack', version)
end end