Permalink
Browse files

Get everything passing again and warn if an adapter is not available

  • Loading branch information...
1 parent 50edcab commit a305fc2cdaa5928d62463af8a89f1cf6fbc04638 @wycats committed May 9, 2009
View
@@ -32,8 +32,9 @@ def update_key(key, options)
end
def store(key, value, options = {})
+ ret = super(key, value)
update_options(key, options)
- super(key, value)
+ ret
end
private
@@ -1,16 +1,20 @@
require File.dirname(__FILE__) + '/spec_helper'
-require 'moneta/berkeley'
-describe "Moneta::Berkeley" do
- before(:each) do
- @cache = Moneta::Berkeley.new(:file => File.join(File.dirname(__FILE__), "berkeley_test.db"))
- @cache.clear
- end
+begin
+ require 'moneta/berkeley'
+
+ describe "Moneta::Berkeley" do
+ before(:each) do
+ @cache = Moneta::Berkeley.new(:file => File.join(File.dirname(__FILE__), "berkeley_test.db"))
+ @cache.clear
+ end
- after(:all) do
- File.delete(File.join(File.dirname(__FILE__), "berkeley_test.db"))
- File.delete(File.join(File.dirname(__FILE__), "berkeley_test.db_expiration"))
- end
+ after(:all) do
+ File.delete(File.join(File.dirname(__FILE__), "berkeley_test.db"))
+ File.delete(File.join(File.dirname(__FILE__), "berkeley_test.db_expiration"))
+ end
- it_should_behave_like "a read/write Moneta cache"
+ it_should_behave_like "a read/write Moneta cache"
+ end
+rescue SystemExit
end
View
@@ -1,18 +1,22 @@
require File.dirname(__FILE__) + '/spec_helper'
-require 'moneta/couch'
-describe "Moneta::Couch" do
- before(:each) do
- @cache = Moneta::Couch.new(:db => "couch_test")
- @expiration = Moneta::Couch.new(:db => "couch_test_expiration", :skip_expires => true)
- @cache.clear
- @expiration.clear
- end
+begin
+ require 'moneta/couch'
- after(:all) do
- @cache.delete_store
- @expiration.delete_store
- end
+ describe "Moneta::Couch" do
+ before(:each) do
+ @cache = Moneta::Couch.new(:db => "couch_test")
+ @expiration = Moneta::Couch.new(:db => "couch_test_expiration", :skip_expires => true)
+ @cache.clear
+ @expiration.clear
+ end
- it_should_behave_like "a read/write Moneta cache"
-end
+ after(:all) do
+ @cache.delete_store
+ @expiration.delete_store
+ end
+
+ it_should_behave_like "a read/write Moneta cache"
+ end
+rescue SystemExit
+end
@@ -1,15 +1,19 @@
require File.dirname(__FILE__) + '/spec_helper'
-require "moneta/datamapper"
-describe "Moneta::DataMapper" do
- before(:each) do
- @cache = Moneta::DataMapper.new(:setup => "sqlite3::memory:")
- @cache.clear
- end
+begin
+ require "moneta/datamapper"
+
+ describe "Moneta::DataMapper" do
+ before(:each) do
+ @cache = Moneta::DataMapper.new(:setup => "sqlite3::memory:")
+ @cache.clear
+ end
- after(:all) do
- MonetaHash.auto_migrate!
- end
+ after(:all) do
+ MonetaHash.auto_migrate!
+ end
- it_should_behave_like "a read/write Moneta cache"
+ it_should_behave_like "a read/write Moneta cache"
+ end
+rescue SystemExit
end
View
@@ -1,18 +1,21 @@
require File.dirname(__FILE__) + '/spec_helper'
-require "moneta/file"
+begin
+ require "moneta/file"
-describe "Moneta::File" do
- before(:each) do
- @cache = Moneta::File.new(:path => File.join(File.dirname(__FILE__), "file_cache"))
- @cache.clear
- end
+ describe "Moneta::File" do
+ before(:each) do
+ @cache = Moneta::File.new(:path => File.join(File.dirname(__FILE__), "file_cache"))
+ @cache.clear
+ end
- after(:all) do
- FileUtils.rm_rf(File.join(File.dirname(__FILE__), "file_cache"))
- end
+ after(:all) do
+ FileUtils.rm_rf(File.join(File.dirname(__FILE__), "file_cache"))
+ end
- if ENV['MONETA_TEST'].nil? || ENV['MONETA_TEST'] == 'file'
- it_should_behave_like "a read/write Moneta cache"
+ if ENV['MONETA_TEST'].nil? || ENV['MONETA_TEST'] == 'file'
+ it_should_behave_like "a read/write Moneta cache"
+ end
end
-end
+rescue SystemExit
+end
@@ -1,12 +1,16 @@
require File.dirname(__FILE__) + '/spec_helper'
-require "moneta/memcache"
-describe "Moneta::Memcache" do
- before(:each) do
- @native_expires = true
- @cache = Moneta::Memcache.new(:server => "localhost:11211", :namespace => "moneta_spec")
- @cache.clear
- end
+begin
+ require "moneta/memcache"
+
+ describe "Moneta::Memcache" do
+ before(:each) do
+ @native_expires = true
+ @cache = Moneta::Memcache.new(:server => "localhost:11211", :namespace => "moneta_spec")
+ @cache.clear
+ end
- it_should_behave_like "a read/write Moneta cache"
-end
+ it_should_behave_like "a read/write Moneta cache"
+ end
+rescue SystemExit
+end
View
@@ -1,12 +1,16 @@
require File.dirname(__FILE__) + '/spec_helper'
-require "moneta/redis"
-describe "Moneta::Redis" do
- before(:each) do
- @native_expires = true
- @cache = Moneta::Redis.new
- @cache.clear
- end
+begin
+ require "moneta/redis"
+
+ describe "Moneta::Redis" do
+ before(:each) do
+ @native_expires = true
+ @cache = Moneta::Redis.new
+ @cache.clear
+ end
- it_should_behave_like "a read/write Moneta cache"
+ it_should_behave_like "a read/write Moneta cache"
+ end
+rescue SystemExit
end
View
@@ -1,11 +1,15 @@
require File.dirname(__FILE__) + '/spec_helper'
-require "moneta/rufus"
-describe "Moneta::Rufus" do
- before(:each) do
- @cache = Moneta::Rufus.new(:file => "cache")
- @cache.clear
- end
+begin
+ require "moneta/rufus"
+
+ describe "Moneta::Rufus" do
+ before(:each) do
+ @cache = Moneta::Rufus.new(:file => "cache")
+ @cache.clear
+ end
- it_should_behave_like "a read/write Moneta cache"
+ it_should_behave_like "a read/write Moneta cache"
+ end
+rescue SystemExit
end
View
@@ -1,15 +1,19 @@
require File.dirname(__FILE__) + '/spec_helper'
-require 'moneta/s3'
-describe "Moneta::S3" do
- before(:each) do
- @cache = Moneta::S3.new(
- :access_key_id => ENV['AWS_ACCESS_KEY_ID'],
- :secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'],
- :bucket => 'moneta_test'
- )
- @cache.clear
- end
+begin
+ require 'moneta/s3'
+
+ describe "Moneta::S3" do
+ before(:each) do
+ @cache = Moneta::S3.new(
+ :access_key_id => ENV['AWS_ACCESS_KEY_ID'],
+ :secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'],
+ :bucket => 'moneta_test'
+ )
+ @cache.clear
+ end
- it_should_behave_like "a read/write Moneta cache"
+ it_should_behave_like "a read/write Moneta cache"
+ end
+rescue SystemExit
end
View
@@ -1,17 +1,21 @@
require File.dirname(__FILE__) + '/spec_helper'
-require "moneta/sdbm"
-describe "Moneta::SDBM" do
- before(:each) do
- @cache = Moneta::SDBM.new(:file => File.join(File.dirname(__FILE__), "sdbm_cache"))
- @cache.clear
- end
+begin
+ require "moneta/sdbm"
+
+ describe "Moneta::SDBM" do
+ before(:each) do
+ @cache = Moneta::SDBM.new(:file => File.join(File.dirname(__FILE__), "sdbm_cache"))
+ @cache.clear
+ end
- after(:all) do
- FileUtils.rm_rf(Dir.glob(File.join(File.dirname(__FILE__), "sdbm_cache*")))
- end
+ after(:all) do
+ FileUtils.rm_rf(Dir.glob(File.join(File.dirname(__FILE__), "sdbm_cache*")))
+ end
- if ENV['MONETA_TEST'].nil? || ENV['MONETA_TEST'] == 'sdbm'
- it_should_behave_like "a read/write Moneta cache"
+ if ENV['MONETA_TEST'].nil? || ENV['MONETA_TEST'] == 'sdbm'
+ it_should_behave_like "a read/write Moneta cache"
+ end
end
+rescue SystemExit
end
View
@@ -1,11 +1,15 @@
require File.dirname(__FILE__) + '/spec_helper'
-require "moneta/tyrant"
-describe "Moneta::Tyrant" do
- before(:each) do
- @cache = Moneta::Tyrant.new(:host => "localhost", :port => 1978)
- @cache.clear
- end
+begin
+ require "moneta/tyrant"
+
+ describe "Moneta::Tyrant" do
+ before(:each) do
+ @cache = Moneta::Tyrant.new(:host => "localhost", :port => 1978)
+ @cache.clear
+ end
- it_should_behave_like "a read/write Moneta cache"
+ it_should_behave_like "a read/write Moneta cache"
+ end
+rescue SystemExit
end
View
@@ -1,17 +1,21 @@
require File.dirname(__FILE__) + '/spec_helper'
-require "moneta/xattr"
-describe "Moneta::Xattrs" do
- before(:each) do
- @cache = Moneta::Xattr.new(:file => File.join(File.dirname(__FILE__), "file_cache", "xattr_cache"))
- @cache.clear
- end
+begin
+ require "moneta/xattr"
+
+ describe "Moneta::Xattrs" do
+ before(:each) do
+ @cache = Moneta::Xattr.new(:file => File.join(File.dirname(__FILE__), "file_cache", "xattr_cache"))
+ @cache.clear
+ end
- after(:all) do
- FileUtils.rm_rf(File.join(File.dirname(__FILE__), "file_cache"))
- end
+ after(:all) do
+ FileUtils.rm_rf(File.join(File.dirname(__FILE__), "file_cache"))
+ end
- if ENV['MONETA_TEST'].nil? || ENV['MONETA_TEST'] == 'xattrs'
- it_should_behave_like "a read/write Moneta cache"
+ if ENV['MONETA_TEST'].nil? || ENV['MONETA_TEST'] == 'xattrs'
+ it_should_behave_like "a read/write Moneta cache"
+ end
end
+rescue SystemExit
end

0 comments on commit a305fc2

Please sign in to comment.