-
Notifications
You must be signed in to change notification settings - Fork 8
/
Rakefile
46 lines (37 loc) · 1.33 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
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env rake
begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
# Dummy App
# -----------------------------------------------------------------------------
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
load 'rails/tasks/engine.rake'
Bundler::GemHelper.install_tasks
Rake::Task['app:db:load_config'].clear
task 'app:db:load_config' do
ActiveRecord::Base.configurations = Rails.application.config.database_configuration
ActiveRecord::Migrator.migrations_paths = Rails.application.paths['db/migrate'].to_a
end
# Teabag
# -----------------------------------------------------------------------------
desc "Run javascript specs"
task teabag: "app:teabag"
# RSpec
# -----------------------------------------------------------------------------
task 'db:test:prepare' => 'app:db:test:prepare'
load 'rspec/rails/tasks/rspec.rake'
namespace :spec do
[:engine].each do |sub|
desc "Run the code examples in spec/#{sub}"
RSpec::Core::RakeTask.new(sub => 'db:test:prepare') do |t|
t.pattern = "./spec/#{sub}/**/*_spec.rb"
end
end
end
# Default
# -----------------------------------------------------------------------------
#Rake::Task['default'].prerequisites.clear
#Rake::Task['default'].clear
task :default => [:spec, :teabag]