guard-rails/Rakefile

33 lines
582 B
Ruby
Raw Normal View History

2011-05-27 18:41:07 +00:00
require 'bundler'
Bundler::GemHelper.install_tasks
2011-06-03 13:26:03 +00:00
2011-06-05 11:25:55 +00:00
desc "Run on this Ruby"
task :spec do
system %{rspec spec}
exit $?.exitstatus
end
2011-06-03 13:26:03 +00:00
namespace :spec do
desc "Run on three Rubies"
task :platforms do
current = %x{rvm-prompt v}
2011-06-03 13:27:44 +00:00
fail = false
2011-06-03 13:26:03 +00:00
%w{1.8.7 1.9.2 ree}.each do |version|
puts "Switching to #{version}"
system %{rvm #{version}}
2011-06-05 11:25:55 +00:00
system %{rspec spec}
2011-06-03 13:27:44 +00:00
if $?.exitstatus != 0
fail = true
break
end
2011-06-03 13:26:03 +00:00
end
system %{rvm #{current}}
2011-06-03 13:27:44 +00:00
exit (fail ? 1 : 0)
2011-06-03 13:26:03 +00:00
end
end
2011-06-04 12:33:42 +00:00
task :default => 'spec:platforms'