Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #7757 from yahonda/skip_non_supported_isolation_level

Skip tests for non-supported isolation levels
  • Loading branch information...
commit f58e82cd736ecaf6edb3cbc5d0a27e9378b9a127 2 parents 2233f14 + 5826b50
Rafael Mendonça França rafaelfranca authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 activerecord/test/cases/transaction_isolation_test.rb
8 activerecord/test/cases/transaction_isolation_test.rb
View
@@ -44,7 +44,9 @@ class Tag2 < ActiveRecord::Base
# 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 Tag2 < ActiveRecord::Base
# 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
Please sign in to comment.
Something went wrong with that request. Please try again.