-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
28 lines (25 loc) · 816 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require_relative 'system/environment'
require_relative 'system/hht/container'
require 'rom-sql'
require 'rom/sql/rake_task'
require 'rspec/core/rake_task'
require 'pry'
namespace :db do
task :setup do
Hht::Container.start(:db)
config = Hht::Container['db.config']
config.gateways[:default].use_logger(Logger.new($stdout))
end
desc 'seed the database with some dummy data'
task :seed do
connection = Hht::Container['db.connection']
queries = File.read(File.join(APP_ROOT, 'db', 'sample-queries.sql'))
connection.run(queries)
end
end
RSpec::Core::RakeTask.new(:spec) do |t|
ROM::SQL::RakeSupport.env = Hht::Container['db.config']
# t.pattern = Dir.glob('spec/transactions/habit_nodes/*_spec.rb')
# t.pattern = Dir.glob('spec/api/domains/**/*_spec.rb')
end
task default: :spec