require_relative './evm_test_helper'

if defined?(RSpec)
namespace :test do
  task :initialize do
    ENV['RAILS_ENV'] ||= "test"
    Rails.env = ENV['RAILS_ENV'] if defined?(Rails)
    ENV['VERBOSE']   ||= "false"

    EvmTestHelper.start_cc_top if ENV['CC_BUILD_ARTIFACTS']
  end

  task :setup_db => :initialize do
    Rake::Task['evm:db:reset'].invoke
  end
end

task :default => 'test:vmdb'
end # ifdef

require_relative './evm_test_helper'

if defined?(RSpec)
namespace :test do
  task :initialize do
    ENV['RAILS_ENV'] ||= "test"
    Rails.env = ENV['RAILS_ENV'] if defined?(Rails)
    ENV['VERBOSE']   ||= "false"

    EvmTestHelper.start_cc_top if ENV['CC_BUILD_ARTIFACTS']
  end

  task :setup_db => :initialize do
    puts "** Preparing database"
    Rake::Task['evm:db:reset'].invoke
  end
end

task :default => 'test:vmdb'
end # ifdef

Add logging for Cruise Control Builds before preparing the database
Add logging for Cruise Control Builds before preparing the database

[skip ci]
