aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-09-25 13:17:44 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-09-25 13:17:44 -0700
commitf58e82cd736ecaf6edb3cbc5d0a27e9378b9a127 (patch)
tree3a837e028e6fbe5a58e92a5c1ecf74c84faabe2a
parent2233f1456f6fb1b92e6c1bded70b89a3302c4306 (diff)
parent5826b5008ff891a8bc9c0dc64a212ed24206245f (diff)
downloadrails-f58e82cd736ecaf6edb3cbc5d0a27e9378b9a127.tar.gz
rails-f58e82cd736ecaf6edb3cbc5d0a27e9378b9a127.tar.bz2
rails-f58e82cd736ecaf6edb3cbc5d0a27e9378b9a127.zip
Merge pull request #7757 from yahonda/skip_non_supported_isolation_level
Skip tests for non-supported isolation levels
-rw-r--r--activerecord/test/cases/transaction_isolation_test.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/activerecord/test/cases/transaction_isolation_test.rb b/activerecord/test/cases/transaction_isolation_test.rb
index c7f36b53b1..a396da6645 100644
--- a/activerecord/test/cases/transaction_isolation_test.rb
+++ b/activerecord/test/cases/transaction_isolation_test.rb
@@ -44,7 +44,9 @@ class TransactionIsolationTest < ActiveRecord::TestCase
# specifies what must not happen at a certain level, not what must happen. At
# the read uncommitted level, there is nothing that must not happen.
test "read uncommitted" do
- return skip "Oracle does not support read uncommitted" if current_adapter? :OracleAdapter
+ unless ActiveRecord::Base.connection.transaction_isolation_levels.include?(:read_uncommitted)
+ skip "database does not support read uncommitted isolation level"
+ end
Tag.transaction(isolation: :read_uncommitted) do
assert_equal 0, Tag.count
Tag2.create
@@ -68,7 +70,9 @@ class TransactionIsolationTest < ActiveRecord::TestCase
# We are testing that a nonrepeatable read does not happen
test "repeatable read" do
- return skip "Oracle does not support repeatble read" if current_adapter? :OracleAdapter
+ unless ActiveRecord::Base.connection.transaction_isolation_levels.include?(:repeatable_read)
+ skip "database does not support repeatable read isolation level"
+ end
tag = Tag.create(name: 'jon')
Tag.transaction(isolation: :repeatable_read) do