forked from ryanb/nested_form
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
53 lines (46 loc) · 1.37 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
require 'rubygems'
require 'rake'
begin
require 'rspec/core/rake_task'
desc "Run RSpec"
RSpec::Core::RakeTask.new do |t|
t.verbose = false
end
rescue LoadError
puts "You should run rake spec:install in order to install all corresponding gems!"
end
task :default => :spec
namespace :db do
desc 'Prepare sqlite database'
task :migrate do
system 'cd spec/dummy && rake db:migrate RAILS_ENV=test && rake db:migrate RAILS_ENV=development'
end
end
namespace :spec do
desc 'Install gems from additional gemfiles'
task :install do
system 'bundle install'
ENV.delete('GEM_HOME')
ENV['BUNDLE_GEMFILE'] = File.expand_path('../gemfiles/Gemfile.rails3_1', __FILE__)
system 'bundle install'
ENV['BUNDLE_GEMFILE'] = File.expand_path('../gemfiles/Gemfile.rails3_0', __FILE__)
system 'bundle install'
end
desc 'Run tests with Rails 3.1.x'
task :rails3_1 do
ENV.delete('GEM_HOME')
ENV['BUNDLE_GEMFILE'] = File.expand_path('../gemfiles/Gemfile.rails3_1', __FILE__)
Rake::Task["spec"].execute
end
desc 'Run tests with Rails 3.0.x'
task :rails3_0 do
ENV.delete('GEM_HOME')
ENV['BUNDLE_GEMFILE'] = File.expand_path('../gemfiles/Gemfile.rails3_0', __FILE__)
Rake::Task["spec"].execute
end
task :all do
Rake::Task["spec"].execute
Rake::Task["spec:rails3_1"].execute
Rake::Task["spec:rails3_0"].execute
end
end