Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # you can use the file ~/.ogrc in case you want change this file for many
- # different repositories and not be bugged with this file.
- # if you simply want exclude it from darcs record, hit 's' when asked
- # if you want to record changes to this file.
- # for more options, use the usual '?'
- ogrc = "#{ENV['HOME']}/.ogrc"
- if File.file?(ogrc)
- puts "Loading #{ogrc}"
- load ogrc
- else
- # 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 :postgresql, :sqlite :kirby :memory
- # CHANGE THIS TO SETUP MOST TESTS
- configA = :psql
- # FOR MULTI-TESTS
- configB = :mysql
- # SET THIS TO true TO ENABLE EXTRA DEBUG CODE
- debug = true
- # 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
- require 'rubygems'
- unless test_against_installation
- require File.expand_path( File.join( File.dirname(__FILE__), '..', '..', '..', 'glycerin.rb' ) )
- end
- $DBG = debug
- og_options = {
- :mysql => {
- :destroy => true,
- :store => :mysql,
- :user => 'john',
- :name => 'test_og',
- # :password => 'gmrulez',
- # :socket => '/var/run/mysqld/mysqld.sock'
- :connection_count => 2
- },
- :psql => {
- :destroy => true,
- :store => :postgresql,
- :user => 'john',
- :password => '',
- :name => 'ogtest',
- :connection_count => 2
- },
- :sqlite => {
- :destroy => true,
- :store => :sqlite,
- :name => 'test'
- },
- :kirby => {
- :destroy => true,
- :store => :kirby,
- :name => 'test',
- :embedded => true
- },
- :memory => {
- :store => :memory,
- :name => :test,
- :destroy => true
- }
- }
- require 'stringio'
- require 'glue'
- require 'glue/logger'
- require 'og'
- Logger.get.level = Logger::ERROR unless $DBG
- $cfgA = og_options[configA]
- $cfgB = og_options[configB]
- Og.thread_safe = false
- $og1 ||= Og.setup($cfgA)
- $og2 ||= Og.setup($cfgB)
- if debug
- require 'ruby-debug'
- Debugger.start
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement