Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Testing Crud Commands
require_relative "database"
require "test/unit"
require 'objspace'
class TestDatabase < Test::Unit::TestCase
def test_get_set_happy_path
#These two methods are tested together because isolating them would require opening direct access to database objects.
db =
db.set "Crested", "Cardinal"
assert_equal("Cardinal", db.get("Crested"))
def test_get_no_value
db =
assert_equal("NULL", db.get("NoKey"))
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.