-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
32 lines (26 loc) · 880 Bytes
/
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
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
namespace :spec do
task :prep_rails1 do
puts 'Preparing environment for Rails 1.x RSpec code examples'
unless RUBY_VERSION =~ /^1\.8/
raise "Rails 1.x doesn't support Ruby versions other than 1.8.x"
end
ENV['RAILS_VERSION'] = '1'
`bundle`
end
task :prep_rails2 do
puts 'Preparing environment for Rails 2.x RSpec code examples'
ENV['RAILS_VERSION'] = '2'
`bundle`
end
desc 'Run RSpec code examples for Rails 1.x compatibility'
RSpec::Core::RakeTask.new(:rails1)
desc 'Run RSpec code examples for Rails 2.x compatibility'
RSpec::Core::RakeTask.new(:rails2)
Rake::Task[:rails1].enhance [:prep_rails1]
Rake::Task[:rails2].enhance [:prep_rails2]
end
desc 'Run RSpec code examples'
task :spec => ['spec:rails1', 'spec:rails2']
task :default => [:spec]