2015-11-03 11:46:54 +03:00
|
|
|
require 'core/devops-application'
|
|
|
|
|
|
|
|
|
|
module SpecSupport
|
|
|
|
|
BLANK_FILE = File.join(Devops::Application.root, 'spec/support/blank_file')
|
2015-11-20 18:31:54 +03:00
|
|
|
TEST_DB = 'devops_test'
|
2015-11-03 11:46:54 +03:00
|
|
|
|
|
|
|
|
def stub_loggers
|
|
|
|
|
allow(DevopsLogger).to receive_message_chain('logger.debug')
|
|
|
|
|
allow(DevopsLogger).to receive_message_chain('logger.info')
|
|
|
|
|
allow(DevopsLogger).to receive_message_chain('logger.error')
|
|
|
|
|
end
|
2015-11-20 18:31:54 +03:00
|
|
|
|
|
|
|
|
def self.db
|
|
|
|
|
@db ||= begin
|
|
|
|
|
require 'mongo'
|
|
|
|
|
Mongo::MongoClient.new.db(TEST_DB)
|
|
|
|
|
end
|
|
|
|
|
end
|
2015-11-03 11:46:54 +03:00
|
|
|
end
|