aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activesupport/CHANGELOG2
-rw-r--r--activesupport/lib/active_support/test_case.rb1
-rw-r--r--activesupport/lib/active_support/testing/turn_formatting.rb33
-rw-r--r--rails.gemspec1
-rw-r--r--railties/CHANGELOG2
-rw-r--r--railties/lib/rails/commands/console.rb2
-rw-r--r--railties/lib/rails/test_help.rb8
-rw-r--r--railties/railties.gemspec1
8 files changed, 12 insertions, 38 deletions
diff --git a/activesupport/CHANGELOG b/activesupport/CHANGELOG
index 1be5f39ac4..373236ce9a 100644
--- a/activesupport/CHANGELOG
+++ b/activesupport/CHANGELOG
@@ -1,7 +1,5 @@
*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
posing for pictures.
diff --git a/activesupport/lib/active_support/test_case.rb b/activesupport/lib/active_support/test_case.rb
index 7ac9ad46e9..8d6c27e381 100644
--- a/activesupport/lib/active_support/test_case.rb
+++ b/activesupport/lib/active_support/test_case.rb
@@ -5,7 +5,6 @@ require 'active_support/testing/deprecation'
require 'active_support/testing/declarative'
require 'active_support/testing/pending'
require 'active_support/testing/isolation'
-require 'active_support/testing/turn_formatting'
require 'active_support/testing/mochaing'
require 'active_support/core_ext/kernel/reporting'
diff --git a/activesupport/lib/active_support/testing/turn_formatting.rb b/activesupport/lib/active_support/testing/turn_formatting.rb
deleted file mode 100644
index ed9381e298..0000000000
--- a/activesupport/lib/active_support/testing/turn_formatting.rb
+++ /dev/null
@@ -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 \ No newline at end of file
diff --git a/rails.gemspec b/rails.gemspec
index 2711d95f34..98b5f46554 100644
--- a/rails.gemspec
+++ b/rails.gemspec
@@ -25,6 +25,5 @@ Gem::Specification.new do |s|
s.add_dependency('activeresource', version)
s.add_dependency('actionmailer', version)
s.add_dependency('railties', version)
- s.add_dependency('turn', '~> 0.8.2')
s.add_dependency('bundler', '~> 1.0')
end
diff --git a/railties/CHANGELOG b/railties/CHANGELOG
index 07e7e461de..f159247308 100644
--- a/railties/CHANGELOG
+++ b/railties/CHANGELOG
@@ -1,5 +1,7 @@
*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]
* 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]
diff --git a/railties/lib/rails/commands/console.rb b/railties/lib/rails/commands/console.rb
index 2a6cdca440..2b7faf9715 100644
--- a/railties/lib/rails/commands/console.rb
+++ b/railties/lib/rails/commands/console.rb
@@ -36,7 +36,7 @@ module Rails
end
if defined?(ActiveRecord)
- ActiveRecord::Base.logger = Logger.new(STDOUT)
+ ActiveRecord::Base.logger = Logger.new(STDERR)
end
if options[:sandbox]
diff --git a/railties/lib/rails/test_help.rb b/railties/lib/rails/test_help.rb
index 00029e627e..b9f7bdc2eb 100644
--- a/railties/lib/rails/test_help.rb
+++ b/railties/lib/rails/test_help.rb
@@ -13,6 +13,14 @@ if defined?(Test::Unit::Util::BacktraceFilter) && ENV['BACKTRACE'].nil?
Test::Unit::Util::BacktraceFilter.module_eval { include Rails::BacktraceFilterForTestUnit }
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)
require 'active_record/test_case'
diff --git a/railties/railties.gemspec b/railties/railties.gemspec
index c51fe856be..1e233c885e 100644
--- a/railties/railties.gemspec
+++ b/railties/railties.gemspec
@@ -22,6 +22,7 @@ Gem::Specification.new do |s|
s.add_dependency('rake', '>= 0.8.7')
s.add_dependency('thor', '~> 0.14.4')
s.add_dependency('rack-ssl', '~> 1.3.2')
+ s.add_dependency('turn', '~> 0.8.2')
s.add_dependency('activesupport', version)
s.add_dependency('actionpack', version)
end