Skip to content

Instantly share code, notes, and snippets.

@tgaff
Created August 15, 2013 16:10
Show Gist options
  • Save tgaff/6242110 to your computer and use it in GitHub Desktop.
Save tgaff/6242110 to your computer and use it in GitHub Desktop.
sauce labs jasmine rake task
namespace :sauce do
desc "Execute Jasmine tests on Sauce Labs with RSpec results, i.e. `rake sauce:jasmine['Windows 2008',iexplore,9]`"
task :jasmine, [:os, :browser, :browser_version] => 'jasmine:require' do |t, args|
RSpec::Core::RakeTask.new(:jasmine_continuous_integration_runner) do |t|
t.rspec_opts = ["--colour", "--format", "documentation"]
t.verbose = true
t.ruby_opts = ["-r #{File.expand_path(File.join(::Rails.root, 'config', 'environment'))}"]
t.pattern = [File.expand_path(File.join('script', 'jasmine_sauce_runner.rb'))]
end
ENV['SAUCE_OS'] = args[:os]
ENV['SAUCE_BROWSER'] = args[:browser]
ENV['SAUCE_BROWSER_VERSION'] = args[:browser_version]
Rake::Task["jasmine_continuous_integration_runner"].invoke
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment