-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
38 lines (32 loc) · 888 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
29
30
31
32
33
34
35
36
37
38
require 'rake'
require 'sinatra/activerecord/rake'
begin
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = Dir.glob('spec/**/*_spec.rb')
t.rspec_opts = '--format documentation'
end
rescue LoadError
end
desc 'run a pry console with the project environment loaded'
task :console do
require 'pry'
puts '-- Project Console --'
Dir.chdir('lib')
system 'pry -I . -I ../ -r environment.rb'
end
namespace :db do
task :load_config do
require './lib/app.rb'
end
# I Don't want to mess with current environment so I use a different rake process
namespace :test do
desc 'Setup the DB test environment (create and migrate)'
task :setup do
system('RACK_ENV=test rake db:create') and
system('RACK_ENV=test rake db:migrate')
end
end
end
desc 'Run all the tests'
task :test => [:'db:test:setup', :spec]