Guest User

Untitled

a guest
Mar 5th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. require "rubygems"
  2. require "spec"
  3. $TESTING = true
  4.  
  5. puts "merb init called"
  6.  
  7. require 'merb/merb_server'
  8.  
  9. dir = File.dirname(__FILE__)
  10. Merb::Server.instance_eval {@@merb_raw_opts = []}
  11. Merb::Server.merb_config
  12. Merb::Server.config[:merb_root] = File.expand_path("#{dir}/../..")
  13. Merb::Server.config[:dist_root] = File.expand_path("#{dir}/../../dist")
  14. Merb::Server.config[:environment] = 'test'
  15.  
  16. require 'merb'
  17.  
  18. $LOAD_PATH << DIST_ROOT+"/app/models/"
  19. $LOAD_PATH << DIST_ROOT+"/app/controllers/"
  20. $LOAD_PATH << DIST_ROOT+"/app/helpers/"
  21.  
  22. require DIST_ROOT+"/conf/merb_init"
  23.  
  24. ActiveRecord::Base.establish_connection('test')
  25.  
  26.  
  27.  
  28.  
  29. !! then in merb_init.rb have:
  30. ActiveRecord::Base.configurations['test'] = {
  31. :adapter => 'mysql',
  32. :username => 'root',
  33. :password => 'xxxxxxx',
  34. :database => 'mrblog_test',
  35. :host => 'localhost'
  36. }
Add Comment
Please, Sign In to add comment