Advertisement
Guest User

Untitled

a guest
Jul 30th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. # you can use the file ~/.ogrc in case you want change this file for many
  2. # different repositories and not be bugged with this file.
  3. # if you simply want exclude it from darcs record, hit 's' when asked
  4. # if you want to record changes to this file.
  5. # for more options, use the usual '?'
  6.  
  7. ogrc = "#{ENV['HOME']}/.ogrc"
  8.  
  9. if File.file?(ogrc)
  10. puts "Loading #{ogrc}"
  11. load ogrc
  12. else
  13. # This file contains og initialization code for all tests.
  14. # This way you only change the parameters in one file in
  15. # order to run all the tests for many stores.
  16. #
  17. # Current store choices are
  18. # :mysql :postgresql, :sqlite :kirby :memory
  19.  
  20. # CHANGE THIS TO SETUP MOST TESTS
  21.  
  22. configA = :psql
  23.  
  24. # FOR MULTI-TESTS
  25.  
  26. configB = :mysql
  27.  
  28. # SET THIS TO true TO ENABLE EXTRA DEBUG CODE
  29.  
  30. debug = true
  31.  
  32.  
  33. # TO TEST AGAINST AN INSTALLATION OF OG INSTEAD THIS LOCAL
  34. # DISTRIBUTION, SET THE FOLLOWING TO true.
  35.  
  36. test_against_installation = false
  37.  
  38.  
  39. #--------------------------------------------------------------
  40. # DO NOT CHANGE ANYTHING BELOW THIS LINE
  41.  
  42. require 'rubygems'
  43.  
  44. unless test_against_installation
  45. require File.expand_path( File.join( File.dirname(__FILE__), '..', '..', '..', 'glycerin.rb' ) )
  46. end
  47.  
  48. $DBG = debug
  49.  
  50. og_options = {
  51. :mysql => {
  52. :destroy => true,
  53. :store => :mysql,
  54. :user => 'john',
  55. :name => 'test_og',
  56. # :password => 'gmrulez',
  57. # :socket => '/var/run/mysqld/mysqld.sock'
  58. :connection_count => 2
  59. },
  60. :psql => {
  61. :destroy => true,
  62. :store => :postgresql,
  63. :user => 'john',
  64. :password => '',
  65. :name => 'ogtest',
  66. :connection_count => 2
  67. },
  68. :sqlite => {
  69. :destroy => true,
  70. :store => :sqlite,
  71. :name => 'test'
  72. },
  73. :kirby => {
  74. :destroy => true,
  75. :store => :kirby,
  76. :name => 'test',
  77. :embedded => true
  78. },
  79. :memory => {
  80. :store => :memory,
  81. :name => :test,
  82. :destroy => true
  83. }
  84. }
  85.  
  86. require 'stringio'
  87. require 'glue'
  88. require 'glue/logger'
  89. require 'og'
  90.  
  91. Logger.get.level = Logger::ERROR unless $DBG
  92.  
  93. $cfgA = og_options[configA]
  94. $cfgB = og_options[configB]
  95.  
  96. Og.thread_safe = false
  97.  
  98. $og1 ||= Og.setup($cfgA)
  99. $og2 ||= Og.setup($cfgB)
  100.  
  101. if debug
  102. require 'ruby-debug'
  103. Debugger.start
  104. end
  105.  
  106. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement