6 def load_connection_from_env(adapter)
8 unless ENV['cpk_adapters']
9 puts error_msg_setup_helper
13 ActiveRecord::Base.configurations = YAML.load(ENV['cpk_adapters'])
14 unless spec = ActiveRecord::Base.configurations[adapter]
15 puts error_msg_adapter_helper
18 spec[:adapter] = adapter
22 def error_msg_setup_helper
25 CPK now has a place for your individual testing configuration.
26 That is, instead of hardcoding it in the Rakefile and test/connections files,
27 there is now a local/database_connections.rb file that is NOT in the
28 repository. Your personal DB information (username, password etc) can
29 be stored here without making it difficult to submit patches etc.
32 i) cp locals/database_connections.rb.sample locals/database_connections.rb
33 ii) For #{adapter} connection details see "Adapter Setup Helper" below.
36 #{error_msg_adapter_helper}
43 def error_msg_adapter_helper
46 To run #{adapter} tests, you need to setup your #{adapter} connections.
47 In your local/database_connections.rb file, within the ENV['cpk_adapter'] hash, add:
48 "#{adapter}" => { adapter settings }
50 That is, it will look like:
51 ENV['cpk_adapters'] = {
53 :adapter => "#{adapter}",