Skip to content

Instantly share code, notes, and snippets.

@jlindsey
Created June 4, 2010 16:46
Show Gist options
  • Save jlindsey/425647 to your computer and use it in GitHub Desktop.
Save jlindsey/425647 to your computer and use it in GitHub Desktop.
desc "Runs the test suite on the Integrity box"
task :integrity do
def exec_with_exit(command_str, put = false)
out = %x{#{command_str}}
puts out if put
exit($?.exitstatus) unless $? == 0
end
ENV['PATH'] = "#{ENV['PATH']}:/usr/local/jruby/jruby-1.5.0/bin"
ENV['GEM_PATH'] = "#{ENV['GEM_PATH']}:/usr/local/jruby/jruby-1.5.0/lib/ruby/gems/1.8"
ENV['RAILS_ENV'] = 'test'
puts "Purging and re-migrating test database...\n"
exec_with_exit "rake db:test:purge"
exec_with_exit "rake db:migrate"
exec_with_exit "rake test:units", true
ENV['RAILS_ENV'] = 'cucumber'
exec_with_exit "rake cucumber", true
exit($?.exitstatus)
end
@jlindsey
Copy link
Author

jlindsey commented Jun 4, 2010

This is assuming you are using:

  • Cucumber
  • Capybara
  • Culerity
    • JRuby in the [semi-]standard path /usr/local/jruby
  • Test::Unit

Fork and edit accordingly for your personal setup (using RSpec instead of Test::Unit for example).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment