Created
May 27, 2019 22:31
-
-
Save chelseatroy/a0b430402a739ba723450eef3f2647bb to your computer and use it in GitHub Desktop.
Test Deletion with Transaction
This file contains 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_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