test/factbase/test_looged.rb in factbase-0.0.46 vs test/factbase/test_looged.rb in factbase-0.0.47
- old
+ new
@@ -55,9 +55,18 @@
)
assert_equal(1, fb.size)
assert(log.to_s.include?('modified'), log)
end
+ def test_with_modifying_txn
+ log = Loog::Buffer.new
+ fb = Factbase::Looged.new(Factbase.new, log)
+ fb.insert.foo = 1
+ assert(!fb.txn { |fbt| fbt.query('(always)').each.to_a }, log)
+ assert(fb.txn { |fbt| fbt.query('(always)').each.to_a[0].foo = 42 }, log)
+ assert(log.to_s.include?('modified'), log)
+ end
+
def test_with_empty_txn
log = Loog::Buffer.new
fb = Factbase::Looged.new(Factbase.new, log)
assert(!fb.txn { |fbt| fbt.query('(always)').each.to_a })
assert(log.to_s.include?('didn\'t touch'), log)