Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Test Deletion with Transaction
...
def test_transaction_with_deletion
db = Database.new
db.set "Homing", "Pigeon"
db.set "Fantail", "Pigeon"
assert_equal(2, db.count("Pigeon"))
db.begin
db.delete "Fantail"
assert_equal(1, db.count("Pigeon"))
assert_equal("NULL", db.get("Fantail"))
db.rollback
assert_equal(2, db.count("Pigeon"))
assert_equal("Pigeon", db.get("Fantail"))
end
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment