1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

asakusa.rb hack night!

Fix in-memory tests
This commit is contained in:
Aaron Patterson + Akira Matsuda 2013-08-06 21:24:28 +09:00 committed by Aaron Patterson
parent 4c1c2e6501
commit 79238bad3d
2 changed files with 5 additions and 0 deletions

View file

@ -55,6 +55,8 @@ class DefaultScopingTest < ActiveRecord::TestCase
end
def test_default_scoping_with_threads
skip "in-memory database mustn't disconnect" if in_memory_db?
2.times do
Thread.new {
assert DeveloperOrderedBySalary.all.to_sql.include?('salary DESC')

View file

@ -545,6 +545,9 @@ if current_adapter?(:PostgreSQLAdapter)
# This will cause transactions to overlap and fail unless they are performed on
# separate database connections.
def test_transaction_per_thread
if in_memory_db?
skip "in memory db can't share a db between threads"
end
threads = 3.times.map do
Thread.new do
Topic.transaction do