Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 40 lines (31 sloc) 1.04 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
require 'rubygems'
require 'bundler'
Bundler.setup

require 'rake'
require 'rake/testtask'

require 'appraisal'

desc 'Default: run all tests.'
task :default => :test

desc "Test state_machine."
Rake::TestTask.new(:test) do |t|
  integration = %w(active_model active_record data_mapper mongoid mongo_mapper sequel).detect do |name|
    Bundler.default_gemfile.to_s.include?(name)
  end
  
  t.libs << 'lib'
  t.test_files = integration ? Dir["test/unit/integrations/#{integration}_test.rb"] : Dir['test/{functional,unit}/*_test.rb'] + ['test/unit/integrations/base_test.rb']
  t.verbose = true
end

namespace :appraisal do
  desc "Run the given task for a particular integration's appraisals"
  task :integration do
    integration = ENV['INTEGRATION']
    
    Appraisal::File.each do |appraisal|
      if appraisal.name.include?(integration)
        appraisal.install
        Appraisal::Command.from_args(appraisal.gemfile_path).run
      end
    end
    
    exit
  end
end

load File.dirname(__FILE__) + '/lib/tasks/state_machine.rake'
Something went wrong with that request. Please try again.