jasmine-headless-webkit/Rakefile

69 lines
1.3 KiB
Ruby
Raw Normal View History

2011-06-19 20:11:22 +00:00
include Rake::DSL if defined?(Rake::DSL)
2011-04-11 10:24:07 +00:00
require 'bundler'
Bundler::GemHelper.install_tasks
2011-06-07 19:04:11 +00:00
2011-08-04 14:38:52 +00:00
begin
require 'hydra'
require 'hydra/tasks'
require 'facter'
Hydra::TestTask.new('hydra:spec') do |t|
t.add_files 'spec/**/*_spec.rb'
end
rescue LoadError
warn "$! - hydra not loaded"
end
HYDRA_LOG = 'hydra-runner.log'
task 'hydra:before' do
rm HYDRA_LOG if File.file?(HYDRA_LOG)
end
task('hydra:spec').enhance(%w{hydra:before}) do
puts File.read(HYDRA_LOG) if File.file?(HYDRA_LOG)
end
2011-06-07 19:04:11 +00:00
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
2011-07-15 21:44:03 +00:00
$: << File.expand_path('../lib', __FILE__)
require 'jasmine/headless/task'
Jasmine::Headless::Task.new
2011-06-07 19:04:11 +00:00
namespace :spec do
desc "Run on three Rubies"
task :platforms do
current = %x{rvm-prompt v}
fail = false
%w{1.8.7 1.9.2 ree}.each do |version|
puts "Switching to #{version}"
Bundler.with_clean_env do
2011-08-04 14:38:52 +00:00
system %{bash -c 'source ~/.rvm/scripts/rvm ; rvm #{version} ; bundle install ; bundle exec rake hydra:spec'}
2011-06-07 19:04:11 +00:00
end
if $?.exitstatus != 0
fail = true
break
end
end
system %{rvm #{current}}
exit (fail ? 1 : 0)
end
end
2011-07-15 21:44:03 +00:00
task :default => [ 'spec:platforms', 'jasmine:headless' ]
2011-06-07 19:04:11 +00:00
desc "Build the runner"
task :build do
Dir.chdir 'ext/jasmine-headless-specrunner' do
system %{ruby extconf.rb}
end
end