Created
May 27, 2019 02:22
-
-
Save chelseatroy/81c3b63d28d4fb29bac83d5a105481ab to your computer and use it in GitHub Desktop.
Rollback Tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
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