From bd43a5d1fa140a489f5635c00abb0a685d9ffce2 Mon Sep 17 00:00:00 2001 From: Vladimir Lyzo Date: Fri, 21 Apr 2023 14:54:24 +1000 Subject: [PATCH] add test --- test/transaction_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/transaction_test.rb b/test/transaction_test.rb index e0e224f..0cc7092 100644 --- a/test/transaction_test.rb +++ b/test/transaction_test.rb @@ -69,5 +69,13 @@ def pg_lock_count end assert_equal(0, pg_lock_count) end + + specify 'transaction level locks fail if not in transaction' do + Tag.with_advisory_lock 'test', transaction: true do + raise 'should not get here' + end + + assert_match(/#{Regexp.escape('requires transaction')}/, exception.message) + end end end