-
Notifications
You must be signed in to change notification settings - Fork 5
/
Rakefile
57 lines (44 loc) · 1.31 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
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env rake
RAKED = true
require 'rubygems'
require 'bundler/setup'
require 'appraisal'
require 'rspec/core/rake_task'
Bundler::GemHelper.install_tasks
# Latest Rails version + SQLite (default db)
RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = "--format progress --colour --no-profile"
t.verbose = false
end
task :default => :test
# Full test suite!
desc "Run the full test suite (All supported Rails version, all supported DBs)."
task :test do
sh "bundle exec appraisal rake test:db:all"
end
databases = %w(sqlite mysql postgresql)
namespace :test do
desc "Setup your databases to run the tests. " \
"You should only need to run this once."
task :setup do
load 'spec/support/test_setup.rb'
TestSetup.setup
databases.each do |database|
$stdout.puts "*** [secretary] Setting up #{database}"
TestSetup.move_database_config(database)
TestSetup.load_database_config
Combustion::Database.reset_database
end
TestSetup.remove_database_config
end
namespace :db do
databases.each do |database|
desc "Run tests against latest stable Rails + #{database}"
task database do
sh "bundle exec rake spec DB=#{database}"
end
end
desc "Run tests against latest stable Rails + all databases"
task :all => databases
end
end