Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This file contains og initialization code for all tests.
- # This way you only change the parameters in one file in
- # order to run all the tests for many stores.
- #
- # Current store choices are
- # :mysql :postgresl :sqlite :kirby :memory
- # CHANGE THIS TO SETUP MOST TESTS
- configA = :postgresql
- # FOR MULTI-TESTS
- configB = :sqlite
- # SET THIS TO true TO ENABLE EXTRA DEBUG CODE
- debug = false
- # TO TEST AGAINST AN INSTALLATION OF OG INSTEAD THIS LOCAL
- # DISTRIBUTION, SET THE FOLLOWING TO true.
- test_against_installation = false
- #--------------------------------------------------------------
- # DO NOT CHANGE ANYTHING BELOW THIS LINE
- unless test_against_installation
- $:.unshift File.expand_path( File.join( File.dirname(__FILE__), '..', '..', 'lib' ) )
- end
- $DBG = debug
- og_mysql = {
- :destroy => true,
- :store => :mysql,
- :user => 'root',
- :name => 'test',
- # :password => 'gmrulez',
- # :socket => '/var/run/mysqld/mysqld.sock'
- }
- og_postgresql = {
- :destroy => true,
- :store => :postgresql,
- :user => `whoami`.chomp,
- #:password => 'postgres',
- :name => 'test'
- }
- og_sqlite = {
- :destroy => true,
- :store => :sqlite,
- :name => 'test'
- }
- og_kirby = {
- :destroy => true,
- :store => :kirby,
- :name => 'test',
- :embedded => true
- }
- og_memory = {
- :store => :memory,
- :name => :test,
- :destroy => true
- }
- # This sets the common global vars to be used by the tests.
- eval %{
- @og_config1 = og_config = og_#{configA}
- @og_config2 = og_#{configB}
- }
- require 'stringio'
- require 'rubygems'
- require Dir.pwd.gsub(%r(^(#{ENV['HOME']}/darcs/.*?)/.*?$), '\1/glycerin')
- require 'glue'
- require 'glue/logger'
- require 'og'
- Logger.get.level = Logger::WARN unless $DBG
- $og1 ||= eval %{ lambda do
- Og.setup(#{@og_config1.inspect})
- end
- }
- def $og1.method_missing(meth, *args, &block)
- call
- end
- $og2 ||= eval %{ lambda do
- Og.setup(#{@og_config2.inspect})
- end
- }
- def $og2.method_missing(meth, *args, &block)
- call
- end
- Og.thread_safe = false if Og.thread_safe
Advertisement
Add Comment
Please, Sign In to add comment