lib/fixtury/test_hooks.rb in fixtury-0.3.4 vs lib/fixtury/test_hooks.rb in fixtury-0.3.5
- old
+ new
@@ -128,22 +128,22 @@
super
end
end
def setup_fixtury_fixtures
- return unless use_transactional_fixtures
+ return unless fixtury_use_transactions?
clear_expired_fixtury_fixtures!
load_all_fixtury_fixtures!
fixtury_database_connections.each do |conn|
conn.begin_transaction joinable: false
end
end
def teardown_fixtury_fixtures
- return unless use_transactional_fixtures
+ return unless fixtury_use_transactions?
fixtury_database_connections.each(&:rollback_transaction)
end
def clear_expired_fixtury_fixtures!
@@ -154,9 +154,16 @@
def load_all_fixtury_fixtures!
(fixtury_dependencies | local_fixtury_dependencies).each do |name|
fixtury(name) unless fixtury_loaded?(name)
end
+ end
+
+ def fixtury_use_transactions?
+ return use_transactional_tests if respond_to?(:use_transactional_tests)
+ return use_transactional_fixtures if respond_to?(:use_transactional_fixtures)
+
+ true
end
end
end