Skip to content

Commit

Permalink
spec_helper.rb: Using YAML based database configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
code-later authored and moonglum committed Oct 23, 2013
1 parent 717fd04 commit 7adcd0b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
11 changes: 11 additions & 0 deletions spec/acceptance/config/guacamole.yml
Original file line number Diff line number Diff line change
@@ -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'
17 changes: 2 additions & 15 deletions spec/acceptance/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -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|
Expand Down

0 comments on commit 7adcd0b

Please sign in to comment.