aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/test_case.rb
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2014-07-16 16:15:16 +0200
committerYves Senn <yves.senn@gmail.com>2014-07-16 16:15:16 +0200
commit2f93aa0d2b304b804853b100174a7ac47a1c4dd5 (patch)
tree5e38f8c4d595404a3c0dead613f95fe845c0c3ca /activerecord/test/cases/test_case.rb
parentf8f5cdc98c4a096ad8bf72190db8a636b2c973db (diff)
downloadrails-2f93aa0d2b304b804853b100174a7ac47a1c4dd5.tar.gz
rails-2f93aa0d2b304b804853b100174a7ac47a1c4dd5.tar.bz2
rails-2f93aa0d2b304b804853b100174a7ac47a1c4dd5.zip
we intend to keep the `capture` helper for Active Record tests.
This is a follow up to f8f5cdc
Diffstat (limited to 'activerecord/test/cases/test_case.rb')
-rw-r--r--activerecord/test/cases/test_case.rb30
1 files changed, 12 insertions, 18 deletions
diff --git a/activerecord/test/cases/test_case.rb b/activerecord/test/cases/test_case.rb
index 80aaead6d9..23a170388e 100644
--- a/activerecord/test/cases/test_case.rb
+++ b/activerecord/test/cases/test_case.rb
@@ -1,9 +1,18 @@
require 'active_support/test_case'
module ActiveRecord
- # The +capture+ helper was deprecated because it is not thread safe.
- # Our own tests still depend on it.
- module UndeprecateCapture
+ # = Active Record Test Case
+ #
+ # Defines some test assertions to test against SQL queries.
+ class TestCase < ActiveSupport::TestCase #:nodoc:
+ def teardown
+ SQLCounter.clear_log
+ end
+
+ def assert_date_from_db(expected, actual, message = nil)
+ assert_equal expected.to_s, actual.to_s, message
+ end
+
def capture(stream)
stream = stream.to_s
captured_stream = Tempfile.new(stream)
@@ -20,21 +29,6 @@ module ActiveRecord
captured_stream.unlink
stream_io.reopen(origin_stream)
end
- end
-
- # = Active Record Test Case
- #
- # Defines some test assertions to test against SQL queries.
- class TestCase < ActiveSupport::TestCase #:nodoc:
- include UndeprecateCapture
-
- def teardown
- SQLCounter.clear_log
- end
-
- def assert_date_from_db(expected, actual, message = nil)
- assert_equal expected.to_s, actual.to_s, message
- end
def capture_sql
SQLCounter.clear_log