-
Notifications
You must be signed in to change notification settings - Fork 2
/
Rakefile
41 lines (33 loc) · 1.08 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
#!/usr/bin/env rake
require 'bundler/setup'
require 'rails/dummy/tasks'
require 'rspec/core/rake_task'
Bundler::GemHelper.install_tasks
ENV['DUMMY_PATH'] = File.expand_path('../spec/dummy', __FILE__)
ENV['ENGINE'] = 'coursewareable'
task :default => :spec
RSpec::Core::RakeTask.new(:spec => 'dummy:app') do |t|
t.rspec_opts = "-I #{File.expand_path('../spec/', __FILE__)}"
t.pattern = File.expand_path('../spec/**/*_spec.rb', __FILE__)
end
namespace :tddium do
desc 'Hook to setup environment on tddium'
task :pre_hook => 'dummy:setup' do
tddium_config = File.expand_path('../config/database.yml', __FILE__)
config = File.expand_path('../spec/dummy/config/database.yml', __FILE__)
sh "cp #{tddium_config} #{config}"
end
desc 'Hook to setup database on tddium'
task :db_hook => ['dummy:install_migrations', 'dummy:migrate']
end
desc 'Run cane to check quality metrics'
begin
require 'cane/rake_task'
Cane::RakeTask.new(:quality) do |cane|
cane.abc_max = 25
end
rescue LoadError
task :quality do
puts 'Cane is not installed, :quality task unavailable'
end
end