Skip to content

Instantly share code, notes, and snippets.

@terlar
Created October 10, 2013 14:25
Show Gist options
  • Save terlar/6919248 to your computer and use it in GitHub Desktop.
Save terlar/6919248 to your computer and use it in GitHub Desktop.
Rakefile for test running
require 'rake/testtask'
require 'bundler/gem_tasks'
namespace 'test' do
test_files = FileList['spec/**/*_spec.rb']
integration_test_files = FileList['spec/**/*_integration_spec.rb']
unit_test_files = test_files - integration_test_files
desc 'Run unit tests'
Rake::TestTask.new('unit') do |t|
t.libs.push 'lib'
t.test_files = unit_test_files
t.verbose = true
end
desc 'Run integration tests'
Rake::TestTask.new('integration') do |t|
t.libs.push 'lib'
t.test_files = integration_test_files
t.verbose = true
end
end
desc 'Run all tests'
task 'test' => %w(test:unit test:integration)
task 'default' => 'test'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment