Advertisement
Guest User

Untitled

a guest
Jul 30th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 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 = :mysql
  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. # TO TEST AGAINST AN INSTALLATION OF OG INSTEAD THIS LOCAL
  33. # DISTRIBUTION, SET THE FOLLOWING TO true.
  34.  
  35. test_against_installation = false
  36.  
  37.  
  38. #--------------------------------------------------------------
  39. # DO NOT CHANGE ANYTHING BELOW THIS LINE
  40.  
  41. unless test_against_installation
  42. $:.unshift File.expand_path( File.join( File.dirname(__FILE__), '..', '..', 'lib' ) )
  43. require File.expand_path( File.join( File.dirname(__FILE__), '..', '..', '..', 'glycerin.rb' ) )
  44. end
  45.  
  46. $DBG = debug
  47.  
  48. og_options = {
  49. :mysql => {
  50. :destroy => true,
  51. :store => :mysql,
  52. :user => 'john',
  53. :name => 'test_og',
  54. # :password => 'gmrulez',
  55. # :socket => '/var/run/mysqld/mysqld.sock'
  56. :connection_count => 2
  57. },
  58. :psql => {
  59. :destroy => true,
  60. :store => :postgresql,
  61. :user => 'john',
  62. :password => '',
  63. :name => 'ogtest',
  64. :connection_count => 2
  65. },
  66. :sqlite => {
  67. :destroy => true,
  68. :store => :sqlite,
  69. :name => 'test'
  70. },
  71. :kirby => {
  72. :destroy => true,
  73. :store => :kirby,
  74. :name => 'test',
  75. :embedded => true
  76. },
  77. :memory => {
  78. :store => :memory,
  79. :name => :test,
  80. :destroy => true
  81. }
  82. }
  83.  
  84. require 'stringio'
  85. require 'glue'
  86. require 'glue/logger'
  87. require 'og'
  88.  
  89. Logger.get.level = Logger::ERROR unless $DBG
  90.  
  91. $cfgA = og_options[configA]
  92. $cfgB = og_options[configB]
  93.  
  94. Og.thread_safe = false
  95.  
  96. $og1 ||= Og.setup($cfgA)
  97. $og2 ||= Og.setup($cfgB)
  98.  
  99. if debug
  100. require 'ruby-debug'
  101. Debugger.start
  102. end
  103.  
  104. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement