Skip to content

Commit

Permalink
Use sqlite3 file database
Browse files Browse the repository at this point in the history
  • Loading branch information
plashchynski committed Mar 7, 2015
1 parent b4d15f7 commit 00e5160
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
pkg/*
*.gem
.bundle
tmp/*.sqlite3
Expand Up @@ -4,7 +4,7 @@ def self.up
t.string :job_id, null: false
t.text :log
t.datetime :last_performed_at
t.timestamps
t.timestamps null: false
end
add_index :crono_jobs, [:job_id], unique: true
end
Expand Down
6 changes: 5 additions & 1 deletion spec/spec_helper.rb
@@ -1,3 +1,5 @@
TMP_DB_FILE = "tmp/test_db.sqlite3"

require 'bundler/setup'
Bundler.setup

Expand All @@ -6,7 +8,9 @@
require 'crono'
require 'generators/crono/install/templates/migrations/create_crono_jobs.rb'

ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
FileUtils.rm(TMP_DB_FILE) if File.exist?(TMP_DB_FILE)

ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: TMP_DB_FILE)
ActiveRecord::Base.logger = Logger.new(STDOUT)
CreateCronoJobs.up

Expand Down
Empty file added tmp/.gitkeep
Empty file.

0 comments on commit 00e5160

Please sign in to comment.