From 79238bad3debae3c36f6e37c4057b30324731b0c Mon Sep 17 00:00:00 2001 From: Aaron Patterson + Akira Matsuda Date: Tue, 6 Aug 2013 21:24:28 +0900 Subject: [PATCH] asakusa.rb hack night! Fix in-memory tests --- activerecord/test/cases/scoping/default_scoping_test.rb | 2 ++ activerecord/test/cases/transactions_test.rb | 3 +++ 2 files changed, 5 insertions(+) diff --git a/activerecord/test/cases/scoping/default_scoping_test.rb b/activerecord/test/cases/scoping/default_scoping_test.rb index 2358e2396d..cd7d91ff85 100644 --- a/activerecord/test/cases/scoping/default_scoping_test.rb +++ b/activerecord/test/cases/scoping/default_scoping_test.rb @@ -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') diff --git a/activerecord/test/cases/transactions_test.rb b/activerecord/test/cases/transactions_test.rb index f84088def3..3aaee5d94f 100644 --- a/activerecord/test/cases/transactions_test.rb +++ b/activerecord/test/cases/transactions_test.rb @@ -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