Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Rollback Tests
...
def test_rollback_with_transaction
db = Database.new
db.set "Bald", "Eagle"
assert_equal(1, db.count("Eagle"))
db.begin
db.set "Golden", "Eagle"
db.rollback
assert_equal(1, db.count("Eagle"))
assert_equal("NULL", db.get("Golden"))
end
def test_rollback_no_transaction
db = Database.new
assert_equal("No transaction in progress", db.rollback)
end
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.