Sha256: d5d52f4c0faabaac11f3b245411f05936adda698c943e0d2a95baefc25225123

Contents?: true

Size: 1.24 KB

Versions: 10

Compression:

Stored size: 1.24 KB

Contents

namespace :testbot do
  task :before_request do
    # This is run after you start a request (ex: rake testbot:spec)
  end
  
  task :before_run do
    # This is run by the runner after files are synced but before tests are run

    # Example: Setting up a test database
    database_yml = <<-DB_CONFIG
test:
  adapter: mysql
  encoding: utf8
  database: <%= options.project %>_testbot_test<%%= ENV['TEST_ENV_NUMBER'] %>
  username: root
  password:
  host: localhost
DB_CONFIG

    # database_file_path = "config/database.yml"
    # File.open(database_file_path, 'w') { |f| f.write(database_yml) }
    # 
    # # Setup databases for all instances
    # 0.upto(ENV['TEST_INSTANCES'].to_i - 1) do |instance|
    #   test_env_number = (instance == 0) ? '' : instance + 1
    #   system "mysqladmin -u root -f drop <%= options.project %>_testbot_test#{test_env_number}  > /dev/null 2>&1"
    #   system "mysqladmin -u root -f create <%= options.project %>_testbot_test#{test_env_number} > /dev/null 2>&1"
    #   system "export RAILS_ENV=test; export TEST_ENV_NUMBER=#{test_env_number}; rake db:test:load"
    # end

    # Example: Building gems
    # system "rm vendor/gems/*/ext/**/*.o > /dev/null 2>&1"
    # system "rake gems:build:force > /dev/null 2>&1"
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
testbot-0.3.5 lib/generators/testbot/templates/testbot.rake.erb
testbot-0.3.4 lib/generators/testbot/templates/testbot.rake.erb
testbot-0.3.3 lib/generators/testbot/templates/testbot.rake.erb
testbot-0.3.2 lib/generators/testbot/templates/testbot.rake.erb
testbot-0.3.1 lib/generators/testbot/templates/testbot.rake.erb
testbot-0.3.0 lib/generators/testbot/templates/testbot.rake.erb
testbot-0.2.9 lib/generators/testbot/templates/testbot.rake.erb
testbot-0.2.8 lib/generators/testbot/templates/testbot.rake.erb
testbot-0.2.7 lib/generators/testbot/templates/testbot.rake.erb
testbot-0.2.6 lib/generators/testbot/templates/testbot.rake.erb