forked from langalex/couch_potato
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
35 lines (30 loc) · 1.06 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
require 'bundler'
Bundler::GemHelper.install_tasks name: 'couch_potato'
require 'rake'
require 'rspec/core/rake_task'
task default: :spec
desc 'Run functional specs'
RSpec::Core::RakeTask.new(:spec_functional) do |spec|
spec.pattern = 'spec/*_spec.rb'
spec.rspec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""]
end
desc 'Run unit specs'
RSpec::Core::RakeTask.new(:spec_unit) do |spec|
spec.pattern = 'spec/unit/*_spec.rb'
spec.rspec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""]
end
desc 'Run all specs'
task :spec do
if ENV['TRAVIS'] # travis handles the environments for us
Rake::Task[:spec_unit].execute
Rake::Task[:spec_functional].execute
else
%w(4_0 4_1 4_2).each do |version|
Bundler.with_clean_env do
puts "Running tests with ActiveSupport #{version.sub('_', '.')}"
sh "env BUNDLE_GEMFILE=gemfiles/active_support_#{version} bundle install"
sh "env BUNDLE_GEMFILE=gemfiles/active_support_#{version} bundle exec rake spec_unit spec_functional"
end
end
end
end