Sha256: 0816ce89e5cfc075ea1b58c8d28d0667c3ebac9a68e90e007232f8dfd96b11e6

Contents?: true

Size: 726 Bytes

Versions: 4

Compression:

Stored size: 726 Bytes

Contents

require 'bundler'
Bundler::GemHelper.install_tasks

DB_CONFIG = "spec/database.yml"

require 'rake'
desc 'Default: run all unit tests.'
task :default => :"spec:all"

namespace :db do
  desc 'Prepare the databases.'
  task :prepare do
    unless File.exist? DB_CONFIG
      cp "#{config_file}.tmpl", DB_CONFIG
    end
    #TODO would be nice to create the DBs here
  end
end

require "rspec/core/rake_task"
desc 'Run the test suite.'
RSpec::Core::RakeTask.new(:spec)

desc 'Run the test suite for all DBs.'
namespace :spec do
  task :all do
    db_config = YAML::load(IO.read(DB_CONFIG))
    db_config.each do |db,config|
      ENV["DB"] = db
      Rake::Task["spec"].reenable
      Rake::Task["spec"].invoke
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
activerecord_enum-0.2.0 Rakefile
activerecord_enum-0.1.1 Rakefile
activerecord_enum-0.1.0 Rakefile
activerecord_enum-0.0.3 Rakefile