moneta 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/.travis.yml +39 -6
- data/CHANGES +18 -0
- data/README.md +69 -31
- data/Rakefile +1 -1
- data/SPEC.md +6 -0
- data/benchmarks/run.rb +235 -133
- data/lib/active_support/cache/moneta_store.rb +1 -0
- data/lib/moneta.rb +29 -19
- data/lib/moneta/adapters/activerecord.rb +18 -26
- data/lib/moneta/adapters/cassandra.rb +5 -7
- data/lib/moneta/adapters/client.rb +3 -5
- data/lib/moneta/adapters/cookie.rb +2 -0
- data/lib/moneta/adapters/couch.rb +1 -3
- data/lib/moneta/adapters/datamapper.rb +4 -6
- data/lib/moneta/adapters/dbm.rb +1 -3
- data/lib/moneta/adapters/file.rb +4 -0
- data/lib/moneta/adapters/fog.rb +2 -4
- data/lib/moneta/adapters/gdbm.rb +1 -3
- data/lib/moneta/adapters/hbase.rb +5 -7
- data/lib/moneta/adapters/leveldb.rb +2 -4
- data/lib/moneta/adapters/localmemcache.rb +1 -3
- data/lib/moneta/adapters/lruhash.rb +1 -3
- data/lib/moneta/adapters/memcached.rb +2 -2
- data/lib/moneta/adapters/{memcached_dalli.rb → memcached/dalli.rb} +4 -6
- data/lib/moneta/adapters/{memcached_native.rb → memcached/native.rb} +8 -7
- data/lib/moneta/adapters/mongo.rb +8 -9
- data/lib/moneta/adapters/pstore.rb +1 -3
- data/lib/moneta/adapters/redis.rb +2 -4
- data/lib/moneta/adapters/riak.rb +3 -5
- data/lib/moneta/adapters/sdbm.rb +1 -13
- data/lib/moneta/adapters/sequel.rb +3 -5
- data/lib/moneta/adapters/sqlite.rb +2 -4
- data/lib/moneta/adapters/tokyocabinet.rb +2 -4
- data/lib/moneta/base.rb +22 -2
- data/lib/moneta/builder.rb +3 -3
- data/lib/moneta/cache.rb +1 -1
- data/lib/moneta/expires.rb +27 -35
- data/lib/moneta/lock.rb +1 -3
- data/lib/moneta/logger.rb +3 -5
- data/lib/moneta/net.rb +7 -3
- data/lib/moneta/proxy.rb +2 -1
- data/lib/moneta/server.rb +33 -21
- data/lib/moneta/shared.rb +11 -7
- data/lib/moneta/stack.rb +1 -1
- data/lib/moneta/transformer.rb +15 -13
- data/lib/moneta/transformer/config.rb +33 -31
- data/lib/moneta/version.rb +1 -1
- data/lib/rack/cache/moneta.rb +6 -0
- data/lib/rack/moneta_cookies.rb +1 -0
- data/lib/rack/session/moneta.rb +1 -0
- data/moneta.gemspec +1 -1
- data/spec/generate.rb +403 -232
- data/spec/helper.rb +23 -2
- data/spec/moneta/adapter_activerecord_spec.rb +3 -2
- data/spec/moneta/adapter_cassandra_spec.rb +4 -3
- data/spec/moneta/adapter_client_spec.rb +4 -3
- data/spec/moneta/adapter_cookie_spec.rb +3 -2
- data/spec/moneta/adapter_couch_spec.rb +3 -2
- data/spec/moneta/adapter_datamapper_spec.rb +3 -2
- data/spec/moneta/adapter_dbm_spec.rb +3 -2
- data/spec/moneta/adapter_file_spec.rb +3 -2
- data/spec/moneta/adapter_fog_spec.rb +3 -2
- data/spec/moneta/adapter_gdbm_spec.rb +3 -2
- data/spec/moneta/adapter_hbase_spec.rb +3 -2
- data/spec/moneta/adapter_leveldb_spec.rb +3 -2
- data/spec/moneta/adapter_localmemcache_spec.rb +3 -2
- data/spec/moneta/adapter_lruhash_spec.rb +3 -2
- data/spec/moneta/adapter_memcached_dalli_spec.rb +4 -3
- data/spec/moneta/adapter_memcached_native_spec.rb +4 -3
- data/spec/moneta/adapter_memcached_spec.rb +4 -3
- data/spec/moneta/adapter_memory_spec.rb +50 -1
- data/spec/moneta/adapter_mongo_spec.rb +3 -2
- data/spec/moneta/adapter_pstore_spec.rb +124 -4
- data/spec/moneta/adapter_redis_spec.rb +4 -3
- data/spec/moneta/adapter_riak_spec.rb +3 -2
- data/spec/moneta/adapter_sdbm_spec.rb +3 -2
- data/spec/moneta/adapter_sequel_spec.rb +3 -2
- data/spec/moneta/adapter_sqlite_spec.rb +3 -2
- data/spec/moneta/adapter_tokyocabinet_bdb_spec.rb +3 -2
- data/spec/moneta/adapter_tokyocabinet_hdb_spec.rb +3 -2
- data/spec/moneta/adapter_yaml_spec.rb +32 -5
- data/spec/moneta/cache_file_memory_spec.rb +3 -2
- data/spec/moneta/cache_memory_null_spec.rb +3 -2
- data/spec/moneta/expires_file_spec.rb +23 -41
- data/spec/moneta/expires_memory_spec.rb +69 -13
- data/spec/moneta/lock_spec.rb +50 -1
- data/spec/moneta/null_adapter_spec.rb +26 -0
- data/spec/moneta/proxy_expires_memory_spec.rb +51 -12
- data/spec/moneta/proxy_redis_spec.rb +4 -3
- data/spec/moneta/shared_spec.rb +4 -3
- data/spec/moneta/simple_activerecord_spec.rb +105 -12
- data/spec/moneta/simple_activerecord_with_expires_spec.rb +106 -13
- data/spec/moneta/simple_cassandra_spec.rb +106 -13
- data/spec/moneta/simple_client_tcp_spec.rb +106 -13
- data/spec/moneta/simple_client_unix_spec.rb +106 -14
- data/spec/moneta/simple_couch_spec.rb +105 -12
- data/spec/moneta/simple_couch_with_expires_spec.rb +106 -13
- data/spec/moneta/simple_datamapper_spec.rb +105 -12
- data/spec/moneta/simple_datamapper_with_expires_spec.rb +106 -13
- data/spec/moneta/simple_datamapper_with_repository_spec.rb +105 -12
- data/spec/moneta/simple_dbm_spec.rb +105 -12
- data/spec/moneta/simple_dbm_with_expires_spec.rb +106 -13
- data/spec/moneta/simple_file_spec.rb +105 -12
- data/spec/moneta/simple_file_with_expires_spec.rb +106 -13
- data/spec/moneta/simple_fog_spec.rb +105 -12
- data/spec/moneta/simple_fog_with_expires_spec.rb +106 -13
- data/spec/moneta/simple_gdbm_spec.rb +105 -12
- data/spec/moneta/simple_gdbm_with_expires_spec.rb +106 -13
- data/spec/moneta/simple_hashfile_spec.rb +105 -12
- data/spec/moneta/simple_hashfile_with_expires_spec.rb +106 -13
- data/spec/moneta/simple_hbase_spec.rb +105 -12
- data/spec/moneta/simple_hbase_with_expires_spec.rb +106 -13
- data/spec/moneta/simple_leveldb_spec.rb +105 -12
- data/spec/moneta/simple_leveldb_with_expires_spec.rb +106 -13
- data/spec/moneta/simple_localmemcache_spec.rb +105 -12
- data/spec/moneta/simple_localmemcache_with_expires_spec.rb +106 -13
- data/spec/moneta/simple_lruhash_spec.rb +70 -12
- data/spec/moneta/simple_lruhash_with_expires_spec.rb +71 -13
- data/spec/moneta/simple_memcached_dalli_spec.rb +106 -13
- data/spec/moneta/simple_memcached_native_spec.rb +106 -13
- data/spec/moneta/simple_memcached_spec.rb +106 -13
- data/spec/moneta/simple_memory_spec.rb +70 -12
- data/spec/moneta/simple_memory_with_compress_spec.rb +70 -12
- data/spec/moneta/simple_memory_with_expires_spec.rb +71 -13
- data/spec/moneta/simple_memory_with_json_key_serializer_spec.rb +41 -15
- data/spec/moneta/simple_memory_with_json_serializer_spec.rb +24 -11
- data/spec/moneta/simple_memory_with_json_value_serializer_spec.rb +45 -14
- data/spec/moneta/simple_memory_with_prefix_spec.rb +70 -12
- data/spec/moneta/simple_memory_with_snappy_compress_spec.rb +70 -12
- data/spec/moneta/simple_mongo_spec.rb +105 -12
- data/spec/moneta/simple_mongo_with_expires_spec.rb +106 -13
- data/spec/moneta/simple_null_spec.rb +36 -1
- data/spec/moneta/simple_pstore_spec.rb +105 -12
- data/spec/moneta/simple_pstore_with_expires_spec.rb +106 -13
- data/spec/moneta/simple_redis_spec.rb +106 -13
- data/spec/moneta/simple_riak_spec.rb +105 -12
- data/spec/moneta/simple_riak_with_expires_spec.rb +106 -13
- data/spec/moneta/simple_sdbm_spec.rb +105 -12
- data/spec/moneta/simple_sdbm_with_expires_spec.rb +106 -13
- data/spec/moneta/simple_sequel_spec.rb +105 -12
- data/spec/moneta/simple_sequel_with_expires_spec.rb +106 -13
- data/spec/moneta/simple_sqlite_spec.rb +105 -12
- data/spec/moneta/simple_sqlite_with_expires_spec.rb +106 -13
- data/spec/moneta/simple_tokyocabinet_spec.rb +105 -12
- data/spec/moneta/simple_tokyocabinet_with_expires_spec.rb +106 -13
- data/spec/moneta/simple_yaml_spec.rb +104 -11
- data/spec/moneta/simple_yaml_with_expires_spec.rb +105 -12
- data/spec/moneta/stack_file_memory_spec.rb +3 -2
- data/spec/moneta/stack_memory_file_spec.rb +3 -1
- data/spec/moneta/transformer_bencode_spec.rb +23 -10
- data/spec/moneta/transformer_bert_spec.rb +23 -10
- data/spec/moneta/transformer_bson_spec.rb +23 -10
- data/spec/moneta/transformer_bzip2_spec.rb +13 -3
- data/spec/moneta/transformer_json_spec.rb +23 -10
- data/spec/moneta/transformer_lzma_spec.rb +13 -3
- data/spec/moneta/transformer_lzo_spec.rb +13 -3
- data/spec/moneta/transformer_marshal_base64_spec.rb +70 -12
- data/spec/moneta/transformer_marshal_escape_spec.rb +70 -12
- data/spec/moneta/transformer_marshal_hmac_spec.rb +70 -12
- data/spec/moneta/transformer_marshal_md5_spec.rb +70 -12
- data/spec/moneta/transformer_marshal_md5_spread_spec.rb +70 -12
- data/spec/moneta/transformer_marshal_prefix_spec.rb +70 -12
- data/spec/moneta/transformer_marshal_rmd160_spec.rb +70 -12
- data/spec/moneta/transformer_marshal_sha1_spec.rb +70 -12
- data/spec/moneta/transformer_marshal_sha256_spec.rb +70 -12
- data/spec/moneta/transformer_marshal_sha384_spec.rb +70 -12
- data/spec/moneta/transformer_marshal_sha512_spec.rb +70 -12
- data/spec/moneta/transformer_marshal_truncate_spec.rb +70 -12
- data/spec/moneta/transformer_marshal_uuencode_spec.rb +70 -12
- data/spec/moneta/transformer_msgpack_spec.rb +23 -10
- data/spec/moneta/transformer_ox_spec.rb +67 -9
- data/spec/moneta/transformer_quicklz_spec.rb +13 -3
- data/spec/moneta/transformer_snappy_spec.rb +13 -3
- data/spec/moneta/transformer_tnet_spec.rb +23 -10
- data/spec/moneta/transformer_yaml_spec.rb +67 -9
- data/spec/moneta/transformer_zlib_spec.rb +13 -3
- data/spec/monetaspecs.rb +4649 -1096
- metadata +8 -5
data/spec/helper.rb
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
require 'moneta'
|
2
2
|
require 'fileutils'
|
3
3
|
require 'monetaspecs'
|
4
|
+
require 'rspec/core/formatters/progress_formatter'
|
5
|
+
|
6
|
+
RSpec::Core::Formatters::ProgressFormatter.class_eval do
|
7
|
+
def example_passed(example)
|
8
|
+
# do nothing
|
9
|
+
end
|
10
|
+
end
|
4
11
|
|
5
12
|
module Moneta
|
6
13
|
class Transformer < Proxy
|
@@ -34,6 +41,20 @@ class Value
|
|
34
41
|
end
|
35
42
|
end
|
36
43
|
|
44
|
+
def safe_load_value(value)
|
45
|
+
load_value(value)
|
46
|
+
rescue Exception => ex
|
47
|
+
value
|
48
|
+
end
|
49
|
+
|
50
|
+
def start_server(*args)
|
51
|
+
server = Moneta::Server.new(*args)
|
52
|
+
Thread.new { server.run }
|
53
|
+
sleep 0.1 until server.running?
|
54
|
+
rescue Exception => ex
|
55
|
+
puts "Failed to start server - #{ex.message}"
|
56
|
+
end
|
57
|
+
|
37
58
|
def make_tempdir
|
38
59
|
# Expand path since datamapper needs absolute path in setup
|
39
60
|
tempdir = File.expand_path(File.join(File.dirname(__FILE__), 'tmp'))
|
@@ -77,8 +98,8 @@ def describe_moneta(name, &block)
|
|
77
98
|
end
|
78
99
|
|
79
100
|
shared_context 'setup_store' do
|
80
|
-
|
81
|
-
new_store
|
101
|
+
def store
|
102
|
+
@store ||= new_store
|
82
103
|
end
|
83
104
|
|
84
105
|
before do
|
@@ -11,10 +11,11 @@ describe_moneta "adapter_activerecord" do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
include_context 'setup_store'
|
14
|
+
it_should_behave_like 'increment'
|
14
15
|
it_should_behave_like 'null_stringkey_stringvalue'
|
15
|
-
it_should_behave_like '
|
16
|
+
it_should_behave_like 'persist_stringkey_stringvalue'
|
16
17
|
it_should_behave_like 'returndifferent_stringkey_stringvalue'
|
17
|
-
it_should_behave_like '
|
18
|
+
it_should_behave_like 'store_stringkey_stringvalue'
|
18
19
|
it 'updates an existing key/value' do
|
19
20
|
store['foo/bar'] = '1'
|
20
21
|
store['foo/bar'] = '2'
|
@@ -11,11 +11,12 @@ describe_moneta "adapter_cassandra" do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
include_context 'setup_store'
|
14
|
+
it_should_behave_like 'expires'
|
15
|
+
it_should_behave_like 'not_increment'
|
14
16
|
it_should_behave_like 'null_stringkey_stringvalue'
|
15
|
-
it_should_behave_like '
|
17
|
+
it_should_behave_like 'persist_stringkey_stringvalue'
|
16
18
|
it_should_behave_like 'returndifferent_stringkey_stringvalue'
|
17
|
-
it_should_behave_like '
|
18
|
-
it_should_behave_like 'expires_stringkey_stringvalue'
|
19
|
+
it_should_behave_like 'store_stringkey_stringvalue'
|
19
20
|
it 'should support default expiration time' do
|
20
21
|
store = Moneta::Adapters::Cassandra.new(:expires => 2, :keyspace => 'adapter_cassandra')
|
21
22
|
store.store('key1', 'val1')
|
@@ -2,7 +2,7 @@
|
|
2
2
|
require 'helper'
|
3
3
|
|
4
4
|
describe_moneta "adapter_client" do
|
5
|
-
|
5
|
+
start_server(Moneta::Adapters::Memory.new)
|
6
6
|
def new_store
|
7
7
|
Moneta::Adapters::Client.new
|
8
8
|
end
|
@@ -12,8 +12,9 @@ describe_moneta "adapter_client" do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
include_context 'setup_store'
|
15
|
+
it_should_behave_like 'increment'
|
15
16
|
it_should_behave_like 'null_stringkey_stringvalue'
|
16
|
-
it_should_behave_like '
|
17
|
+
it_should_behave_like 'persist_stringkey_stringvalue'
|
17
18
|
it_should_behave_like 'returndifferent_stringkey_stringvalue'
|
18
|
-
it_should_behave_like '
|
19
|
+
it_should_behave_like 'store_stringkey_stringvalue'
|
19
20
|
end
|
@@ -11,8 +11,9 @@ describe_moneta "adapter_cookie" do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
include_context 'setup_store'
|
14
|
+
it_should_behave_like 'increment'
|
15
|
+
it_should_behave_like 'not_persist'
|
14
16
|
it_should_behave_like 'null_stringkey_stringvalue'
|
15
|
-
it_should_behave_like 'store_stringkey_stringvalue'
|
16
17
|
it_should_behave_like 'returndifferent_stringkey_stringvalue'
|
17
|
-
it_should_behave_like '
|
18
|
+
it_should_behave_like 'store_stringkey_stringvalue'
|
18
19
|
end
|
@@ -11,8 +11,9 @@ describe_moneta "adapter_couch" do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
include_context 'setup_store'
|
14
|
+
it_should_behave_like 'not_increment'
|
14
15
|
it_should_behave_like 'null_stringkey_stringvalue'
|
15
|
-
it_should_behave_like '
|
16
|
+
it_should_behave_like 'persist_stringkey_stringvalue'
|
16
17
|
it_should_behave_like 'returndifferent_stringkey_stringvalue'
|
17
|
-
it_should_behave_like '
|
18
|
+
it_should_behave_like 'store_stringkey_stringvalue'
|
18
19
|
end
|
@@ -13,10 +13,11 @@ describe_moneta "adapter_datamapper" do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
include_context 'setup_store'
|
16
|
+
it_should_behave_like 'not_increment'
|
16
17
|
it_should_behave_like 'null_stringkey_stringvalue'
|
17
|
-
it_should_behave_like '
|
18
|
+
it_should_behave_like 'persist_stringkey_stringvalue'
|
18
19
|
it_should_behave_like 'returndifferent_stringkey_stringvalue'
|
19
|
-
it_should_behave_like '
|
20
|
+
it_should_behave_like 'store_stringkey_stringvalue'
|
20
21
|
it 'does not cross contaminate when storing' do
|
21
22
|
first = Moneta::Adapters::DataMapper.new(:setup => "sqlite3://#{make_tempdir}/datamapper-first")
|
22
23
|
first.clear
|
@@ -11,8 +11,9 @@ describe_moneta "adapter_dbm" do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
include_context 'setup_store'
|
14
|
+
it_should_behave_like 'increment'
|
14
15
|
it_should_behave_like 'null_stringkey_stringvalue'
|
15
|
-
it_should_behave_like '
|
16
|
+
it_should_behave_like 'persist_stringkey_stringvalue'
|
16
17
|
it_should_behave_like 'returndifferent_stringkey_stringvalue'
|
17
|
-
it_should_behave_like '
|
18
|
+
it_should_behave_like 'store_stringkey_stringvalue'
|
18
19
|
end
|
@@ -11,8 +11,9 @@ describe_moneta "adapter_file" do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
include_context 'setup_store'
|
14
|
+
it_should_behave_like 'increment'
|
14
15
|
it_should_behave_like 'null_stringkey_stringvalue'
|
15
|
-
it_should_behave_like '
|
16
|
+
it_should_behave_like 'persist_stringkey_stringvalue'
|
16
17
|
it_should_behave_like 'returndifferent_stringkey_stringvalue'
|
17
|
-
it_should_behave_like '
|
18
|
+
it_should_behave_like 'store_stringkey_stringvalue'
|
18
19
|
end
|
@@ -16,8 +16,9 @@ describe_moneta "adapter_fog" do
|
|
16
16
|
end
|
17
17
|
|
18
18
|
include_context 'setup_store'
|
19
|
+
it_should_behave_like 'not_increment'
|
19
20
|
it_should_behave_like 'null_stringkey_stringvalue'
|
20
|
-
it_should_behave_like '
|
21
|
+
it_should_behave_like 'persist_stringkey_stringvalue'
|
21
22
|
it_should_behave_like 'returndifferent_stringkey_stringvalue'
|
22
|
-
it_should_behave_like '
|
23
|
+
it_should_behave_like 'store_stringkey_stringvalue'
|
23
24
|
end
|
@@ -11,8 +11,9 @@ describe_moneta "adapter_gdbm" do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
include_context 'setup_store'
|
14
|
+
it_should_behave_like 'increment'
|
14
15
|
it_should_behave_like 'null_stringkey_stringvalue'
|
15
|
-
it_should_behave_like '
|
16
|
+
it_should_behave_like 'persist_stringkey_stringvalue'
|
16
17
|
it_should_behave_like 'returndifferent_stringkey_stringvalue'
|
17
|
-
it_should_behave_like '
|
18
|
+
it_should_behave_like 'store_stringkey_stringvalue'
|
18
19
|
end
|
@@ -11,8 +11,9 @@ describe_moneta "adapter_hbase" do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
include_context 'setup_store'
|
14
|
+
it_should_behave_like 'increment'
|
14
15
|
it_should_behave_like 'null_stringkey_stringvalue'
|
15
|
-
it_should_behave_like '
|
16
|
+
it_should_behave_like 'persist_stringkey_stringvalue'
|
16
17
|
it_should_behave_like 'returndifferent_stringkey_stringvalue'
|
17
|
-
it_should_behave_like '
|
18
|
+
it_should_behave_like 'store_stringkey_stringvalue'
|
18
19
|
end
|
@@ -11,8 +11,9 @@ describe_moneta "adapter_leveldb" do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
include_context 'setup_store'
|
14
|
+
it_should_behave_like 'increment'
|
14
15
|
it_should_behave_like 'null_stringkey_stringvalue'
|
15
|
-
it_should_behave_like '
|
16
|
+
it_should_behave_like 'persist_stringkey_stringvalue'
|
16
17
|
it_should_behave_like 'returndifferent_stringkey_stringvalue'
|
17
|
-
it_should_behave_like '
|
18
|
+
it_should_behave_like 'store_stringkey_stringvalue'
|
18
19
|
end
|
@@ -11,8 +11,9 @@ describe_moneta "adapter_localmemcache" do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
include_context 'setup_store'
|
14
|
+
it_should_behave_like 'not_increment'
|
14
15
|
it_should_behave_like 'null_stringkey_stringvalue'
|
15
|
-
it_should_behave_like '
|
16
|
+
it_should_behave_like 'persist_stringkey_stringvalue'
|
16
17
|
it_should_behave_like 'returndifferent_stringkey_stringvalue'
|
17
|
-
it_should_behave_like '
|
18
|
+
it_should_behave_like 'store_stringkey_stringvalue'
|
18
19
|
end
|
@@ -11,10 +11,11 @@ describe_moneta "adapter_lruhash" do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
include_context 'setup_store'
|
14
|
+
it_should_behave_like 'increment'
|
15
|
+
it_should_behave_like 'not_persist'
|
14
16
|
it_should_behave_like 'null_stringkey_stringvalue'
|
15
|
-
it_should_behave_like 'store_stringkey_stringvalue'
|
16
17
|
it_should_behave_like 'returndifferent_stringkey_stringvalue'
|
17
|
-
it_should_behave_like '
|
18
|
+
it_should_behave_like 'store_stringkey_stringvalue'
|
18
19
|
it 'should delete oldest' do
|
19
20
|
store = Moneta::Adapters::LRUHash.new(:max_size => 10)
|
20
21
|
store[0] = 'y'
|
@@ -11,11 +11,12 @@ describe_moneta "adapter_memcached_dalli" do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
include_context 'setup_store'
|
14
|
+
it_should_behave_like 'expires'
|
15
|
+
it_should_behave_like 'increment'
|
14
16
|
it_should_behave_like 'null_stringkey_stringvalue'
|
15
|
-
it_should_behave_like '
|
17
|
+
it_should_behave_like 'persist_stringkey_stringvalue'
|
16
18
|
it_should_behave_like 'returndifferent_stringkey_stringvalue'
|
17
|
-
it_should_behave_like '
|
18
|
-
it_should_behave_like 'increment'
|
19
|
+
it_should_behave_like 'store_stringkey_stringvalue'
|
19
20
|
it 'should support default expiration time' do
|
20
21
|
store = Moneta::Adapters::MemcachedDalli.new(:expires => 2, :namespace => "adapter_memcached_dalli")
|
21
22
|
store.store('key1', 'val1')
|
@@ -11,11 +11,12 @@ describe_moneta "adapter_memcached_native" do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
include_context 'setup_store'
|
14
|
+
it_should_behave_like 'expires'
|
15
|
+
it_should_behave_like 'increment'
|
14
16
|
it_should_behave_like 'null_stringkey_stringvalue'
|
15
|
-
it_should_behave_like '
|
17
|
+
it_should_behave_like 'persist_stringkey_stringvalue'
|
16
18
|
it_should_behave_like 'returndifferent_stringkey_stringvalue'
|
17
|
-
it_should_behave_like '
|
18
|
-
it_should_behave_like 'increment'
|
19
|
+
it_should_behave_like 'store_stringkey_stringvalue'
|
19
20
|
it 'should support default expiration time' do
|
20
21
|
store = Moneta::Adapters::MemcachedNative.new(:expires => 2, :namespace => "adapter_memcached_native")
|
21
22
|
store.store('key1', 'val1')
|
@@ -11,11 +11,12 @@ describe_moneta "adapter_memcached" do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
include_context 'setup_store'
|
14
|
+
it_should_behave_like 'expires'
|
15
|
+
it_should_behave_like 'increment'
|
14
16
|
it_should_behave_like 'null_stringkey_stringvalue'
|
15
|
-
it_should_behave_like '
|
17
|
+
it_should_behave_like 'persist_stringkey_stringvalue'
|
16
18
|
it_should_behave_like 'returndifferent_stringkey_stringvalue'
|
17
|
-
it_should_behave_like '
|
18
|
-
it_should_behave_like 'increment'
|
19
|
+
it_should_behave_like 'store_stringkey_stringvalue'
|
19
20
|
it 'should support default expiration time' do
|
20
21
|
store = Moneta::Adapters::Memcached.new(:expires => 2, :namespace => "adapter_memcached")
|
21
22
|
store.store('key1', 'val1')
|
@@ -11,29 +11,78 @@ describe_moneta "adapter_memory" do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
include_context 'setup_store'
|
14
|
+
it_should_behave_like 'increment'
|
15
|
+
it_should_behave_like 'not_persist'
|
14
16
|
it_should_behave_like 'null_objectkey_objectvalue'
|
15
17
|
it_should_behave_like 'null_objectkey_stringvalue'
|
16
18
|
it_should_behave_like 'null_objectkey_hashvalue'
|
17
19
|
it_should_behave_like 'null_objectkey_booleanvalue'
|
20
|
+
it_should_behave_like 'null_objectkey_nilvalue'
|
21
|
+
it_should_behave_like 'null_objectkey_integervalue'
|
18
22
|
it_should_behave_like 'null_stringkey_objectvalue'
|
19
23
|
it_should_behave_like 'null_stringkey_stringvalue'
|
20
24
|
it_should_behave_like 'null_stringkey_hashvalue'
|
21
25
|
it_should_behave_like 'null_stringkey_booleanvalue'
|
26
|
+
it_should_behave_like 'null_stringkey_nilvalue'
|
27
|
+
it_should_behave_like 'null_stringkey_integervalue'
|
22
28
|
it_should_behave_like 'null_hashkey_objectvalue'
|
23
29
|
it_should_behave_like 'null_hashkey_stringvalue'
|
24
30
|
it_should_behave_like 'null_hashkey_hashvalue'
|
25
31
|
it_should_behave_like 'null_hashkey_booleanvalue'
|
32
|
+
it_should_behave_like 'null_hashkey_nilvalue'
|
33
|
+
it_should_behave_like 'null_hashkey_integervalue'
|
34
|
+
it_should_behave_like 'null_booleankey_objectvalue'
|
35
|
+
it_should_behave_like 'null_booleankey_stringvalue'
|
36
|
+
it_should_behave_like 'null_booleankey_hashvalue'
|
37
|
+
it_should_behave_like 'null_booleankey_booleanvalue'
|
38
|
+
it_should_behave_like 'null_booleankey_nilvalue'
|
39
|
+
it_should_behave_like 'null_booleankey_integervalue'
|
40
|
+
it_should_behave_like 'null_nilkey_objectvalue'
|
41
|
+
it_should_behave_like 'null_nilkey_stringvalue'
|
42
|
+
it_should_behave_like 'null_nilkey_hashvalue'
|
43
|
+
it_should_behave_like 'null_nilkey_booleanvalue'
|
44
|
+
it_should_behave_like 'null_nilkey_nilvalue'
|
45
|
+
it_should_behave_like 'null_nilkey_integervalue'
|
46
|
+
it_should_behave_like 'null_integerkey_objectvalue'
|
47
|
+
it_should_behave_like 'null_integerkey_stringvalue'
|
48
|
+
it_should_behave_like 'null_integerkey_hashvalue'
|
49
|
+
it_should_behave_like 'null_integerkey_booleanvalue'
|
50
|
+
it_should_behave_like 'null_integerkey_nilvalue'
|
51
|
+
it_should_behave_like 'null_integerkey_integervalue'
|
26
52
|
it_should_behave_like 'store_objectkey_objectvalue'
|
27
53
|
it_should_behave_like 'store_objectkey_stringvalue'
|
28
54
|
it_should_behave_like 'store_objectkey_hashvalue'
|
29
55
|
it_should_behave_like 'store_objectkey_booleanvalue'
|
56
|
+
it_should_behave_like 'store_objectkey_nilvalue'
|
57
|
+
it_should_behave_like 'store_objectkey_integervalue'
|
30
58
|
it_should_behave_like 'store_stringkey_objectvalue'
|
31
59
|
it_should_behave_like 'store_stringkey_stringvalue'
|
32
60
|
it_should_behave_like 'store_stringkey_hashvalue'
|
33
61
|
it_should_behave_like 'store_stringkey_booleanvalue'
|
62
|
+
it_should_behave_like 'store_stringkey_nilvalue'
|
63
|
+
it_should_behave_like 'store_stringkey_integervalue'
|
34
64
|
it_should_behave_like 'store_hashkey_objectvalue'
|
35
65
|
it_should_behave_like 'store_hashkey_stringvalue'
|
36
66
|
it_should_behave_like 'store_hashkey_hashvalue'
|
37
67
|
it_should_behave_like 'store_hashkey_booleanvalue'
|
38
|
-
it_should_behave_like '
|
68
|
+
it_should_behave_like 'store_hashkey_nilvalue'
|
69
|
+
it_should_behave_like 'store_hashkey_integervalue'
|
70
|
+
it_should_behave_like 'store_booleankey_objectvalue'
|
71
|
+
it_should_behave_like 'store_booleankey_stringvalue'
|
72
|
+
it_should_behave_like 'store_booleankey_hashvalue'
|
73
|
+
it_should_behave_like 'store_booleankey_booleanvalue'
|
74
|
+
it_should_behave_like 'store_booleankey_nilvalue'
|
75
|
+
it_should_behave_like 'store_booleankey_integervalue'
|
76
|
+
it_should_behave_like 'store_nilkey_objectvalue'
|
77
|
+
it_should_behave_like 'store_nilkey_stringvalue'
|
78
|
+
it_should_behave_like 'store_nilkey_hashvalue'
|
79
|
+
it_should_behave_like 'store_nilkey_booleanvalue'
|
80
|
+
it_should_behave_like 'store_nilkey_nilvalue'
|
81
|
+
it_should_behave_like 'store_nilkey_integervalue'
|
82
|
+
it_should_behave_like 'store_integerkey_objectvalue'
|
83
|
+
it_should_behave_like 'store_integerkey_stringvalue'
|
84
|
+
it_should_behave_like 'store_integerkey_hashvalue'
|
85
|
+
it_should_behave_like 'store_integerkey_booleanvalue'
|
86
|
+
it_should_behave_like 'store_integerkey_nilvalue'
|
87
|
+
it_should_behave_like 'store_integerkey_integervalue'
|
39
88
|
end
|
@@ -11,8 +11,9 @@ describe_moneta "adapter_mongo" do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
include_context 'setup_store'
|
14
|
+
it_should_behave_like 'not_increment'
|
14
15
|
it_should_behave_like 'null_stringkey_stringvalue'
|
15
|
-
it_should_behave_like '
|
16
|
+
it_should_behave_like 'persist_stringkey_stringvalue'
|
16
17
|
it_should_behave_like 'returndifferent_stringkey_stringvalue'
|
17
|
-
it_should_behave_like '
|
18
|
+
it_should_behave_like 'store_stringkey_stringvalue'
|
18
19
|
end
|
@@ -11,11 +11,131 @@ describe_moneta "adapter_pstore" do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
include_context 'setup_store'
|
14
|
-
it_should_behave_like 'null_stringkey_stringvalue'
|
15
|
-
it_should_behave_like 'store_stringkey_stringvalue'
|
16
|
-
it_should_behave_like 'returndifferent_stringkey_stringvalue'
|
17
14
|
it_should_behave_like 'increment'
|
15
|
+
it_should_behave_like 'null_objectkey_objectvalue'
|
16
|
+
it_should_behave_like 'null_objectkey_stringvalue'
|
17
|
+
it_should_behave_like 'null_objectkey_hashvalue'
|
18
|
+
it_should_behave_like 'null_objectkey_booleanvalue'
|
19
|
+
it_should_behave_like 'null_objectkey_nilvalue'
|
20
|
+
it_should_behave_like 'null_objectkey_integervalue'
|
18
21
|
it_should_behave_like 'null_stringkey_objectvalue'
|
19
|
-
it_should_behave_like '
|
22
|
+
it_should_behave_like 'null_stringkey_stringvalue'
|
23
|
+
it_should_behave_like 'null_stringkey_hashvalue'
|
24
|
+
it_should_behave_like 'null_stringkey_booleanvalue'
|
25
|
+
it_should_behave_like 'null_stringkey_nilvalue'
|
26
|
+
it_should_behave_like 'null_stringkey_integervalue'
|
27
|
+
it_should_behave_like 'null_hashkey_objectvalue'
|
28
|
+
it_should_behave_like 'null_hashkey_stringvalue'
|
29
|
+
it_should_behave_like 'null_hashkey_hashvalue'
|
30
|
+
it_should_behave_like 'null_hashkey_booleanvalue'
|
31
|
+
it_should_behave_like 'null_hashkey_nilvalue'
|
32
|
+
it_should_behave_like 'null_hashkey_integervalue'
|
33
|
+
it_should_behave_like 'null_booleankey_objectvalue'
|
34
|
+
it_should_behave_like 'null_booleankey_stringvalue'
|
35
|
+
it_should_behave_like 'null_booleankey_hashvalue'
|
36
|
+
it_should_behave_like 'null_booleankey_booleanvalue'
|
37
|
+
it_should_behave_like 'null_booleankey_nilvalue'
|
38
|
+
it_should_behave_like 'null_booleankey_integervalue'
|
39
|
+
it_should_behave_like 'null_nilkey_objectvalue'
|
40
|
+
it_should_behave_like 'null_nilkey_stringvalue'
|
41
|
+
it_should_behave_like 'null_nilkey_hashvalue'
|
42
|
+
it_should_behave_like 'null_nilkey_booleanvalue'
|
43
|
+
it_should_behave_like 'null_nilkey_nilvalue'
|
44
|
+
it_should_behave_like 'null_nilkey_integervalue'
|
45
|
+
it_should_behave_like 'null_integerkey_objectvalue'
|
46
|
+
it_should_behave_like 'null_integerkey_stringvalue'
|
47
|
+
it_should_behave_like 'null_integerkey_hashvalue'
|
48
|
+
it_should_behave_like 'null_integerkey_booleanvalue'
|
49
|
+
it_should_behave_like 'null_integerkey_nilvalue'
|
50
|
+
it_should_behave_like 'null_integerkey_integervalue'
|
51
|
+
it_should_behave_like 'persist_objectkey_objectvalue'
|
52
|
+
it_should_behave_like 'persist_objectkey_stringvalue'
|
53
|
+
it_should_behave_like 'persist_objectkey_hashvalue'
|
54
|
+
it_should_behave_like 'persist_objectkey_booleanvalue'
|
55
|
+
it_should_behave_like 'persist_objectkey_nilvalue'
|
56
|
+
it_should_behave_like 'persist_objectkey_integervalue'
|
57
|
+
it_should_behave_like 'persist_stringkey_objectvalue'
|
58
|
+
it_should_behave_like 'persist_stringkey_stringvalue'
|
59
|
+
it_should_behave_like 'persist_stringkey_hashvalue'
|
60
|
+
it_should_behave_like 'persist_stringkey_booleanvalue'
|
61
|
+
it_should_behave_like 'persist_stringkey_nilvalue'
|
62
|
+
it_should_behave_like 'persist_stringkey_integervalue'
|
63
|
+
it_should_behave_like 'persist_hashkey_objectvalue'
|
64
|
+
it_should_behave_like 'persist_hashkey_stringvalue'
|
65
|
+
it_should_behave_like 'persist_hashkey_hashvalue'
|
66
|
+
it_should_behave_like 'persist_hashkey_booleanvalue'
|
67
|
+
it_should_behave_like 'persist_hashkey_nilvalue'
|
68
|
+
it_should_behave_like 'persist_hashkey_integervalue'
|
69
|
+
it_should_behave_like 'persist_booleankey_objectvalue'
|
70
|
+
it_should_behave_like 'persist_booleankey_stringvalue'
|
71
|
+
it_should_behave_like 'persist_booleankey_hashvalue'
|
72
|
+
it_should_behave_like 'persist_booleankey_booleanvalue'
|
73
|
+
it_should_behave_like 'persist_booleankey_nilvalue'
|
74
|
+
it_should_behave_like 'persist_booleankey_integervalue'
|
75
|
+
it_should_behave_like 'persist_nilkey_objectvalue'
|
76
|
+
it_should_behave_like 'persist_nilkey_stringvalue'
|
77
|
+
it_should_behave_like 'persist_nilkey_hashvalue'
|
78
|
+
it_should_behave_like 'persist_nilkey_booleanvalue'
|
79
|
+
it_should_behave_like 'persist_nilkey_nilvalue'
|
80
|
+
it_should_behave_like 'persist_nilkey_integervalue'
|
81
|
+
it_should_behave_like 'persist_integerkey_objectvalue'
|
82
|
+
it_should_behave_like 'persist_integerkey_stringvalue'
|
83
|
+
it_should_behave_like 'persist_integerkey_hashvalue'
|
84
|
+
it_should_behave_like 'persist_integerkey_booleanvalue'
|
85
|
+
it_should_behave_like 'persist_integerkey_nilvalue'
|
86
|
+
it_should_behave_like 'persist_integerkey_integervalue'
|
87
|
+
it_should_behave_like 'returndifferent_objectkey_objectvalue'
|
88
|
+
it_should_behave_like 'returndifferent_objectkey_stringvalue'
|
89
|
+
it_should_behave_like 'returndifferent_objectkey_hashvalue'
|
20
90
|
it_should_behave_like 'returndifferent_stringkey_objectvalue'
|
91
|
+
it_should_behave_like 'returndifferent_stringkey_stringvalue'
|
92
|
+
it_should_behave_like 'returndifferent_stringkey_hashvalue'
|
93
|
+
it_should_behave_like 'returndifferent_hashkey_objectvalue'
|
94
|
+
it_should_behave_like 'returndifferent_hashkey_stringvalue'
|
95
|
+
it_should_behave_like 'returndifferent_hashkey_hashvalue'
|
96
|
+
it_should_behave_like 'returndifferent_booleankey_objectvalue'
|
97
|
+
it_should_behave_like 'returndifferent_booleankey_stringvalue'
|
98
|
+
it_should_behave_like 'returndifferent_booleankey_hashvalue'
|
99
|
+
it_should_behave_like 'returndifferent_nilkey_objectvalue'
|
100
|
+
it_should_behave_like 'returndifferent_nilkey_stringvalue'
|
101
|
+
it_should_behave_like 'returndifferent_nilkey_hashvalue'
|
102
|
+
it_should_behave_like 'returndifferent_integerkey_objectvalue'
|
103
|
+
it_should_behave_like 'returndifferent_integerkey_stringvalue'
|
104
|
+
it_should_behave_like 'returndifferent_integerkey_hashvalue'
|
105
|
+
it_should_behave_like 'store_objectkey_objectvalue'
|
106
|
+
it_should_behave_like 'store_objectkey_stringvalue'
|
107
|
+
it_should_behave_like 'store_objectkey_hashvalue'
|
108
|
+
it_should_behave_like 'store_objectkey_booleanvalue'
|
109
|
+
it_should_behave_like 'store_objectkey_nilvalue'
|
110
|
+
it_should_behave_like 'store_objectkey_integervalue'
|
111
|
+
it_should_behave_like 'store_stringkey_objectvalue'
|
112
|
+
it_should_behave_like 'store_stringkey_stringvalue'
|
113
|
+
it_should_behave_like 'store_stringkey_hashvalue'
|
114
|
+
it_should_behave_like 'store_stringkey_booleanvalue'
|
115
|
+
it_should_behave_like 'store_stringkey_nilvalue'
|
116
|
+
it_should_behave_like 'store_stringkey_integervalue'
|
117
|
+
it_should_behave_like 'store_hashkey_objectvalue'
|
118
|
+
it_should_behave_like 'store_hashkey_stringvalue'
|
119
|
+
it_should_behave_like 'store_hashkey_hashvalue'
|
120
|
+
it_should_behave_like 'store_hashkey_booleanvalue'
|
121
|
+
it_should_behave_like 'store_hashkey_nilvalue'
|
122
|
+
it_should_behave_like 'store_hashkey_integervalue'
|
123
|
+
it_should_behave_like 'store_booleankey_objectvalue'
|
124
|
+
it_should_behave_like 'store_booleankey_stringvalue'
|
125
|
+
it_should_behave_like 'store_booleankey_hashvalue'
|
126
|
+
it_should_behave_like 'store_booleankey_booleanvalue'
|
127
|
+
it_should_behave_like 'store_booleankey_nilvalue'
|
128
|
+
it_should_behave_like 'store_booleankey_integervalue'
|
129
|
+
it_should_behave_like 'store_nilkey_objectvalue'
|
130
|
+
it_should_behave_like 'store_nilkey_stringvalue'
|
131
|
+
it_should_behave_like 'store_nilkey_hashvalue'
|
132
|
+
it_should_behave_like 'store_nilkey_booleanvalue'
|
133
|
+
it_should_behave_like 'store_nilkey_nilvalue'
|
134
|
+
it_should_behave_like 'store_nilkey_integervalue'
|
135
|
+
it_should_behave_like 'store_integerkey_objectvalue'
|
136
|
+
it_should_behave_like 'store_integerkey_stringvalue'
|
137
|
+
it_should_behave_like 'store_integerkey_hashvalue'
|
138
|
+
it_should_behave_like 'store_integerkey_booleanvalue'
|
139
|
+
it_should_behave_like 'store_integerkey_nilvalue'
|
140
|
+
it_should_behave_like 'store_integerkey_integervalue'
|
21
141
|
end
|