aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/transactions_test.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-11-08 13:57:51 -0200
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-11-08 13:59:07 -0200
commitbd09afb5fb3e2047c605660dac6ef4495c419716 (patch)
tree205df2ab04d92e8093c341e132726325e9c40656 /activerecord/test/cases/transactions_test.rb
parent3d5e83fea4cc070fc55da535b7777a914301e284 (diff)
downloadrails-bd09afb5fb3e2047c605660dac6ef4495c419716.tar.gz
rails-bd09afb5fb3e2047c605660dac6ef4495c419716.tar.bz2
rails-bd09afb5fb3e2047c605660dac6ef4495c419716.zip
Don't skip tests if we don't need to.
We can conditional define the tests depending on the adapter or connection. Lets keep the skip for fail tests that need to be fixed.
Diffstat (limited to 'activerecord/test/cases/transactions_test.rb')
-rw-r--r--activerecord/test/cases/transactions_test.rb28
1 files changed, 14 insertions, 14 deletions
diff --git a/activerecord/test/cases/transactions_test.rb b/activerecord/test/cases/transactions_test.rb
index 980981903a..cda4e7453b 100644
--- a/activerecord/test/cases/transactions_test.rb
+++ b/activerecord/test/cases/transactions_test.rb
@@ -571,23 +571,23 @@ if current_adapter?(:PostgreSQLAdapter)
class ConcurrentTransactionTest < TransactionTest
# This will cause transactions to overlap and fail unless they are performed on
# separate database connections.
- def test_transaction_per_thread
- skip "in memory db can't share a db between threads" if in_memory_db?
-
- threads = 3.times.map do
- Thread.new do
- Topic.transaction do
- topic = Topic.find(1)
- topic.approved = !topic.approved?
- assert topic.save!
- topic.approved = !topic.approved?
- assert topic.save!
+ unless in_memory_db?
+ def test_transaction_per_thread
+ threads = 3.times.map do
+ Thread.new do
+ Topic.transaction do
+ topic = Topic.find(1)
+ topic.approved = !topic.approved?
+ assert topic.save!
+ topic.approved = !topic.approved?
+ assert topic.save!
+ end
+ Topic.connection.close
end
- Topic.connection.close
end
- end
- threads.each { |t| t.join }
+ threads.each { |t| t.join }
+ end
end
# Test for dirty reads among simultaneous transactions.