Skip to content

Instantly share code, notes, and snippets.

@phlco
Last active December 29, 2015 00:09
Show Gist options
  • Save phlco/7584448 to your computer and use it in GitHub Desktop.
Save phlco/7584448 to your computer and use it in GitHub Desktop.
travis rake task for jasmine and rspec
language: ruby
rvm:
- 1.9.3
before_script:
- "sh -e /etc/init.d/xvfb start"
- "export DISPLAY=:99.0"
- "export JASMINE_SPEC_FORMAT=documentation"
script:
- "bundle exec rake travis:run"
env:
- PG_USERNAME='postgres'
group :development, :test do
gem 'coveralls', require: false
end
# must occur before any of your application code is required
require 'coveralls'
Coveralls.wear_merged!
require 'coveralls/rake/task'
Coveralls::RakeTask.new
namespace :travis do
desc "Prepare DB and run Tests"
task :run do
["db:create", "db:migrate RAILS_ENV=test", "spec", "jasmine:ci", "coveralls:push"].each do |cmd|
puts "Starting to run #{cmd}..."
system("bundle exec rake #{cmd}")
raise "#{cmd} failed!" unless $?.exitstatus == 0
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment