Sha256: 4e667fba13abcad7c200d67da772ddd669e0438d8fe5cf3ae82f0f5a4c112454

Contents?: true

Size: 1.27 KB

Versions: 5

Compression:

Stored size: 1.27 KB

Contents

require 'rubygems'
require 'bundler'
Bundler.setup

require 'rake'
require 'rake/testtask'
require 'rcov/rcovtask'

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 :test do
  desc "Test state_machine with Rcov."
  Rcov::RcovTask.new(:rcov) do |t|
    t.libs << 'lib'
    t.test_files = Dir['test/**/*_test.rb']
    t.rcov_opts << '--exclude="^(?!lib/)"'
    t.verbose = true
  end
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'

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
state_machine-1.1.2 Rakefile
state_machine-1.1.1 Rakefile
state_machine-1.1.0 Rakefile
state_machine-1.0.3 Rakefile
state_machine-1.0.2 Rakefile