From 5ee9351362d78a55a7bbe7ad98b62b18981fbf47 Mon Sep 17 00:00:00 2001 From: Adam Townsend Date: Thu, 12 Oct 2023 11:42:14 -0700 Subject: [PATCH] added db initialization to make sure the db exists and is up to date before tests --- spec/create_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/create_spec.rb b/spec/create_spec.rb index bcb4c25..a088c88 100644 --- a/spec/create_spec.rb +++ b/spec/create_spec.rb @@ -7,6 +7,12 @@ require 'sequel' require 'rspec' require 'rack/test' +# DB initialization +Sequel.extension :migration +Sequel.sqlite("db/#{ENV['DB_NAME']}") do |db| + Sequel::Migrator.apply(db, "db/migrations") +end + def app App end