Skip to content

Commit

Permalink
Reorder DB constants, fix typo, include sequel_helper for db_spec.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
botimer committed Mar 5, 2018
1 parent 17e8a51 commit 0146cca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/checkpoint/db.rb
Expand Up @@ -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.'
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions spec/checkpoint/db_spec.rb
Expand Up @@ -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
Expand Down

0 comments on commit 0146cca

Please sign in to comment.