diff --git a/lib/checkpoint/db.rb b/lib/checkpoint/db.rb index 0665633..7f2390d 100644 --- a/lib/checkpoint/db.rb +++ b/lib/checkpoint/db.rb @@ -10,11 +10,6 @@ module DB # Any error with the database that Checkpoint itself detects but cannot handle. class DatabaseError < StandardError; end - LOAD_ERROR = <<~MSG - Error loading Checkpoint database models. - Verify connection information and that the database is migrated. - MSG - CONNECTION_ERROR = 'The Checkpoint database is not initialized. Call initialize! first.' ALREADY_CONNECTED = 'Already connected; refusing to connect to another database.' @@ -25,6 +20,11 @@ class DatabaseError < StandardError; end See Checkpoint::DB.connect! for help. MSG + LOAD_ERROR = <<~MSG + Error loading Checkpoint database models. + Verify connection information and that the database is migrated. + MSG + SCHEMA_HEADER = "# Checkpoint Database Version\n" class << self @@ -80,7 +80,7 @@ def connect!(config = {}) end # Run any pending migrations. - # This will connect with the current config if not already conencted. + # This will connect with the current config if not already connected. def migrate! connect! unless connected? Sequel.extension :migration diff --git a/spec/checkpoint/db_spec.rb b/spec/checkpoint/db_spec.rb index 8298841..2a0f389 100644 --- a/spec/checkpoint/db_spec.rb +++ b/spec/checkpoint/db_spec.rb @@ -6,6 +6,7 @@ # group has to do a lot of fiddling to both verify the behavior and cooperate # with the other tests. +require 'sequel_helper' require 'yaml' RSpec.describe Checkpoint::DB do