forked from bploetz/versionist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
36 lines (30 loc) · 1.07 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
require 'rspec/core/rake_task'
require File.expand_path('../lib/versionist/version', __FILE__)
GEMFILE_MAP = {"gemfiles/Rails-3.0" => "Rails 3.0", "gemfiles/Rails-3.1" => "Rails 3.1", "gemfiles/Rails-3.2" => "Rails 3.2", "gemfiles/RailsAPI-0.0" => "Rails API 0.0"}
# To run the tests locally:
# gem install bundler
# rake test:all
namespace :test do
desc "Installs all dependencies"
task :setup do
GEMFILE_MAP.each do |gemfile, name|
puts "Installing gems for testing with #{name} ..."
sh "env BUNDLE_GEMFILE=#{File.dirname(__FILE__) + '/' + gemfile} bundle install"
end
end
GEMFILE_MAP.each do |gemfile, name|
desc "Run all tests against #{name}"
task gemfile.downcase.gsub(/\./, "_") do
sh "env BUNDLE_GEMFILE=#{gemfile} bundle exec rake"
end
end
task :all=> [:setup] + GEMFILE_MAP.map {|gemfile, name| "test:#{gemfile.downcase.gsub(/\./, "_")}"}
end
task :build do
system "gem build versionist.gemspec"
end
desc "Run all specs"
RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = "spec/**/*_spec.rb"
end
task :default => [:spec]