From e3328a6a37015cae515a45cb8a3c083c74d5989f Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 28 Dec 2012 14:56:31 +0100 Subject: use the memory adapter for tests and ensure that we pass adapter_options --- lib/trocla.rb | 2 +- spec/spec_helper.rb | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/trocla.rb b/lib/trocla.rb index 5b5772a..d59ea68 100644 --- a/lib/trocla.rb +++ b/lib/trocla.rb @@ -67,7 +67,7 @@ class Trocla require 'moneta' require "moneta/adapters/#{config['adapter'].downcase}" lconfig = config - Moneta.new(lconfig['adapter'], lconfig['adapter_options']) + Moneta.new(lconfig['adapter'], lconfig['adapter_options']||{}) end def config diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 64ce0de..461a858 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -19,9 +19,8 @@ end def test_config return @config unless @config.nil? @config = default_config - yaml_path = File.expand_path(base_dir+'/spec/data/test_config.yaml') - File.unlink(yaml_path) if File.exists?(yaml_path) - @config['adapter_options'][:path] = yaml_path + @config.delete('adapter_options') + @config['adapter'] = :Memory @config end -- cgit v1.2.3