Sha256: 301c012f060bf01246ecec153a32dd795db3c0ee3c7f9038769349a1b2abe8a4
Contents?: true
Size: 652 Bytes
Versions: 1
Compression:
Stored size: 652 Bytes
Contents
require 'forwardable' module TestSupport class DatabaseConfig extend Forwardable def initialize @config = load_config end def_delegator :@config, :map private PATH = File.expand_path('../config/database.yml', File.dirname(__FILE__)) TEMPLATE_PATH = PATH + '.template' def load_config YAML.load_file(PATH) rescue Errno::ENOENT print_config_instructions raise 'Missing database config' end def print_config_instructions puts "Missing config at #{PATH}" puts "Please create it by copying and editing #{TEMPLATE_PATH}" end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sqlpostgres-1.3.0 | spec/lib/database_config.rb |