-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathRakefile
37 lines (26 loc) · 1.11 KB
/
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
require 'bundler/setup'
require 'thor'
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
load 'rails/tasks/engine.rake' if File.exists? 'spec/dummy/Rakefile'
Bundler::GemHelper.install_tasks
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec) do |spec|
spec.rspec_opts = "-I #{File.expand_path('../spec/', __FILE__)}"
spec.pattern = FileList[File.expand_path('../spec/**/*_spec.rb', __FILE__)]
end
task default: :spec
task :setup_db do
# Use system so that we load the dummy app's Rake commands.
# Drop any existing db so that it is recreated; Hide output so there's no stack trace if the db doesn't exist
system('cd spec/dummy && RAILS_ENV=test bundle exec rake db:drop >/dev/null 2>&1')
# Use system so that we funcitonally test the install generator.
system("cd spec/dummy && RAILS_ENV=test bundle exec rake db:create && RAILS_ENV=test bundle exec rake db:migrate")
end
require 'rails/dummy/tasks'
task :skip_concerns do
ENV['SKIP_CONCERNS'] = 'true'
end
task :skip_decorators do
ENV['SKIP_DECORATORS'] = 'true'
end
task :spec => [ :skip_concerns, :skip_decorators ]