guard-jasmine-headless-webkit/Rakefile

39 lines
841 B
Ruby
Raw Permalink Normal View History

2011-05-23 22:37:19 +00:00
require 'bundler'
Bundler::GemHelper.install_tasks
2011-05-26 20:56:02 +00:00
2011-06-18 16:17:22 +00:00
include Rake::DSL if defined?(Rake::DSL)
2011-05-26 20:56:02 +00:00
desc 'Push everywhere!'
task :push_everywhere do
system %{git push origin master}
system %{git push guard master}
end
2011-06-03 20:25:00 +00:00
2011-06-06 13:49:37 +00:00
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
2012-01-11 16:31:19 +00:00
PLATFORMS = %w{1.8.7 1.9.2 ree 1.9.3}
2011-10-11 19:30:39 +00:00
def rvm_bundle(command = '')
Bundler.with_clean_env do
2012-01-11 16:31:19 +00:00
system %{bash -c 'unset BUNDLE_BIN_PATH && unset BUNDLE_GEMFILE && rvm #{PLATFORMS.join(',')} do bundle #{command}'}
2011-10-11 19:30:39 +00:00
end
end
class SpecFailure < StandardError; end
class BundleFailure < StandardError; end
2011-06-03 20:25:00 +00:00
namespace :spec do
desc "Run on three Rubies"
task :platforms do
2011-10-11 19:30:39 +00:00
rvm_bundle "update"
rvm_bundle "exec rspec spec"
2012-01-11 16:31:19 +00:00
rvm_bundle "exec cucumber"
2011-10-11 19:30:39 +00:00
raise SpecError.new if $?.exitstatus != 0
2011-06-03 20:25:00 +00:00
end
end
task :default => 'spec:platforms'
2011-10-11 19:30:39 +00:00