From 7adcd0b30c89a03e47835806472a7cde09f0c9f4 Mon Sep 17 00:00:00 2001 From: Dirk Breuer Date: Sat, 19 Oct 2013 20:22:42 +0200 Subject: [PATCH] spec_helper.rb: Using YAML based database configuration --- spec/acceptance/config/guacamole.yml | 11 +++++++++++ spec/acceptance/spec_helper.rb | 17 ++--------------- 2 files changed, 13 insertions(+), 15 deletions(-) create mode 100644 spec/acceptance/config/guacamole.yml diff --git a/spec/acceptance/config/guacamole.yml b/spec/acceptance/config/guacamole.yml new file mode 100644 index 0000000..661624a --- /dev/null +++ b/spec/acceptance/config/guacamole.yml @@ -0,0 +1,11 @@ +# FIXME: This is copied from Ashikawa::Core for now but is not recommended. This +# setup uses the default database instead of a custom DB. Due to this we're deleting +# all collections in the default database each time we run the specs. +# => This is not good! +test: + protocol: 'http' + host: 'localhost' + port: 8529 + password: '' + username: '' + database: '_system' diff --git a/spec/acceptance/spec_helper.rb b/spec/acceptance/spec_helper.rb index d3693c8..5f4fcc9 100644 --- a/spec/acceptance/spec_helper.rb +++ b/spec/acceptance/spec_helper.rb @@ -32,13 +32,7 @@ def validate_instance Fabrication::Schematic::Definition::GENERATORS.unshift Fabrication::Generator::Guacamole -# FIXME: This is copied from Ashikawa::Core for now but is not recommended. This -# setup uses the default database instead of a custom DB. Due to this we're deleting -# all collections in the default database each time we run the specs. -# => This is not good! -port = ENV['ARANGODB_PORT'] || 8529 -username = ENV['ARANGODB_USERNAME'] || 'root' -password = ENV['ARANGODB_PASSWORD'] || '' +ENV['GUACAMOLE_ENV'] = 'test' Guacamole.configure do |config| logger = Logging.logger['guacamole_logger'] @@ -49,14 +43,7 @@ def validate_instance config.logger = logger - config.database = Ashikawa::Core::Database.new { |arango_config| - arango_config.url = "http://localhost:#{port}" - unless ENV['ARANGODB_DISABLE_AUTHENTIFICATION'] - arango_config.username = username - arango_config.password = password - end - arango_config.logger = config.logger - } + config.load File.join(File.dirname(__FILE__), 'config', 'guacamole.yml') end RSpec.configure do |config|