Skip to content

Instantly share code, notes, and snippets.

@chelseatroy
Created May 23, 2019 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chelseatroy/736233bf782ca6aeb997bd13f0be7689 to your computer and use it in GitHub Desktop.
Save chelseatroy/736233bf782ca6aeb997bd13f0be7689 to your computer and use it in GitHub Desktop.
Delete Tests
...
def test_delete_happy_path
db = Database.new
db.set "Tufted", "Titmouse"
assert_equal("Titmouse", db.get("Tufted"))
db.delete "Tufted"
assert_equal("NULL", db.get("Tufted"))
end
def test_delete_absent_key
db = Database.new
assert_equal("That key isn't in the database!", db.delete("NoKey"))
end
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment