cirandas.net

ref: master

vendor/ezcrypto/test/test_helper.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
$:.unshift(File.dirname(__FILE__) + '/../lib')

require 'test/unit'
require 'rubygems'
require 'action_pack'
require 'active_record'
#require 'active_support/binding_of_caller'
#require 'active_support/breakpoint'


unless defined?(Rails.root)
  root_path = File.join(File.dirname(__FILE__), '..')
  unless RUBY_PLATFORM =~ /mswin32/
    require 'pathname'
    root_path = Pathname.new(root_path).cleanpath.to_s
  end
  Rails.root = root_path
end


require 'active_record/fixtures'
require 'initializer'

Rails::Initializer.run(:set_load_path)

ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/debug.log")
ActiveRecord::Base.establish_connection(
    :adapter  => "mysql",
    :host     => "localhost",
    :username => "root",
    :password => "",
    :database => "crypto_test"
  )
#load(File.dirname(__FILE__) + "/schema.rb")