moneta 0.7.6 → 0.7.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (200) hide show
  1. data/CHANGES +15 -0
  2. data/README.md +160 -50
  3. data/Rakefile +11 -2
  4. data/SPEC.md +7 -2
  5. data/lib/moneta.rb +7 -1
  6. data/lib/moneta/adapters/activerecord.rb +27 -3
  7. data/lib/moneta/adapters/cassandra.rb +1 -1
  8. data/lib/moneta/adapters/client.rb +8 -2
  9. data/lib/moneta/adapters/cookie.rb +1 -1
  10. data/lib/moneta/adapters/couch.rb +2 -1
  11. data/lib/moneta/adapters/datamapper.rb +16 -0
  12. data/lib/moneta/adapters/daybreak.rb +19 -1
  13. data/lib/moneta/adapters/file.rb +12 -0
  14. data/lib/moneta/adapters/hbase.rb +1 -2
  15. data/lib/moneta/adapters/lruhash.rb +4 -1
  16. data/lib/moneta/adapters/memcached.rb +7 -3
  17. data/lib/moneta/adapters/memcached/dalli.rb +8 -2
  18. data/lib/moneta/adapters/memcached/native.rb +10 -3
  19. data/lib/moneta/adapters/memory.rb +1 -0
  20. data/lib/moneta/adapters/mongo.rb +32 -5
  21. data/lib/moneta/adapters/pstore.rb +13 -2
  22. data/lib/moneta/adapters/redis.rb +19 -0
  23. data/lib/moneta/adapters/restclient.rb +1 -1
  24. data/lib/moneta/adapters/sequel.rb +20 -6
  25. data/lib/moneta/adapters/sqlite.rb +13 -1
  26. data/lib/moneta/adapters/tokyocabinet.rb +5 -0
  27. data/lib/moneta/cache.rb +10 -0
  28. data/lib/moneta/expires.rb +19 -22
  29. data/lib/moneta/lock.rb +2 -2
  30. data/lib/moneta/mixins.rb +33 -11
  31. data/lib/moneta/optionmerger.rb +1 -1
  32. data/lib/moneta/proxy.rb +13 -8
  33. data/lib/moneta/server.rb +13 -6
  34. data/lib/moneta/shared.rb +6 -10
  35. data/lib/moneta/synchronize.rb +125 -0
  36. data/lib/moneta/transformer.rb +50 -42
  37. data/lib/moneta/transformer/config.rb +34 -32
  38. data/lib/moneta/utils.rb +20 -0
  39. data/lib/moneta/version.rb +1 -1
  40. data/lib/moneta/weak.rb +17 -0
  41. data/lib/moneta/wrapper.rb +5 -0
  42. data/lib/rack/moneta_cookies.rb +2 -2
  43. data/lib/rack/moneta_store.rb +4 -4
  44. data/script/benchmarks +3 -9
  45. data/script/generate-specs +278 -41
  46. data/script/install-bundle +2 -2
  47. data/spec/moneta/adapter_activerecord_spec.rb +1 -0
  48. data/spec/moneta/adapter_cassandra_spec.rb +1 -0
  49. data/spec/moneta/adapter_cassandra_with_default_expires_spec.rb +1 -0
  50. data/spec/moneta/adapter_client_spec.rb +1 -0
  51. data/spec/moneta/adapter_cookie_spec.rb +1 -0
  52. data/spec/moneta/adapter_couch_spec.rb +1 -0
  53. data/spec/moneta/adapter_datamapper_spec.rb +1 -0
  54. data/spec/moneta/adapter_daybreak_spec.rb +1 -0
  55. data/spec/moneta/adapter_dbm_spec.rb +1 -0
  56. data/spec/moneta/adapter_file_spec.rb +1 -0
  57. data/spec/moneta/adapter_fog_spec.rb +1 -0
  58. data/spec/moneta/adapter_gdbm_spec.rb +1 -1
  59. data/spec/moneta/adapter_hbase_spec.rb +1 -0
  60. data/spec/moneta/adapter_leveldb_spec.rb +1 -0
  61. data/spec/moneta/adapter_localmemcache_spec.rb +1 -0
  62. data/spec/moneta/adapter_lruhash_spec.rb +1 -0
  63. data/spec/moneta/adapter_memcached_dalli_spec.rb +2 -0
  64. data/spec/moneta/adapter_memcached_dalli_with_default_expires_spec.rb +2 -0
  65. data/spec/moneta/adapter_memcached_native_spec.rb +2 -0
  66. data/spec/moneta/adapter_memcached_native_with_default_expires_spec.rb +2 -0
  67. data/spec/moneta/adapter_memcached_spec.rb +2 -0
  68. data/spec/moneta/adapter_memcached_with_default_expires_spec.rb +2 -0
  69. data/spec/moneta/adapter_memory_spec.rb +1 -0
  70. data/spec/moneta/adapter_mongo_spec.rb +2 -0
  71. data/spec/moneta/adapter_mongo_with_default_expires_spec.rb +2 -0
  72. data/spec/moneta/adapter_pstore_spec.rb +1 -0
  73. data/spec/moneta/adapter_redis_spec.rb +2 -0
  74. data/spec/moneta/adapter_redis_with_default_expires_spec.rb +2 -0
  75. data/spec/moneta/adapter_restclient_spec.rb +1 -0
  76. data/spec/moneta/adapter_riak_spec.rb +1 -0
  77. data/spec/moneta/adapter_sdbm_spec.rb +1 -0
  78. data/spec/moneta/adapter_sequel_spec.rb +1 -0
  79. data/spec/moneta/adapter_sqlite_spec.rb +1 -0
  80. data/spec/moneta/adapter_tdb_spec.rb +1 -0
  81. data/spec/moneta/adapter_tokyocabinet_bdb_spec.rb +1 -0
  82. data/spec/moneta/adapter_tokyocabinet_hdb_spec.rb +1 -0
  83. data/spec/moneta/adapter_yaml_spec.rb +1 -0
  84. data/spec/moneta/cache_file_memory_spec.rb +1 -0
  85. data/spec/moneta/cache_memory_null_spec.rb +1 -0
  86. data/spec/moneta/expires_file_spec.rb +3 -1
  87. data/spec/moneta/expires_memory_spec.rb +2 -0
  88. data/spec/moneta/expires_memory_with_default_expires_spec.rb +2 -0
  89. data/spec/moneta/lock_spec.rb +1 -0
  90. data/spec/moneta/mutex_spec.rb +71 -0
  91. data/spec/moneta/null_adapter_spec.rb +1 -0
  92. data/spec/moneta/optionmerger_spec.rb +5 -7
  93. data/spec/moneta/pool_spec.rb +1 -0
  94. data/spec/moneta/proxy_expires_memory_spec.rb +2 -0
  95. data/spec/moneta/proxy_redis_spec.rb +2 -0
  96. data/spec/moneta/semaphore_spec.rb +84 -0
  97. data/spec/moneta/{shared_spec.rb → shared_tcp_spec.rb} +4 -3
  98. data/spec/moneta/shared_unix_spec.rb +37 -0
  99. data/spec/moneta/simple_activerecord_spec.rb +1 -0
  100. data/spec/moneta/simple_activerecord_with_expires_spec.rb +3 -1
  101. data/spec/moneta/simple_cassandra_spec.rb +1 -0
  102. data/spec/moneta/simple_client_tcp_spec.rb +1 -0
  103. data/spec/moneta/simple_client_unix_spec.rb +3 -2
  104. data/spec/moneta/simple_couch_spec.rb +1 -0
  105. data/spec/moneta/simple_couch_with_expires_spec.rb +2 -1
  106. data/spec/moneta/simple_datamapper_spec.rb +1 -0
  107. data/spec/moneta/simple_datamapper_with_expires_spec.rb +3 -1
  108. data/spec/moneta/simple_datamapper_with_repository_spec.rb +1 -0
  109. data/spec/moneta/simple_daybreak_spec.rb +1 -0
  110. data/spec/moneta/simple_daybreak_with_expires_spec.rb +3 -1
  111. data/spec/moneta/simple_dbm_spec.rb +1 -0
  112. data/spec/moneta/simple_dbm_with_expires_spec.rb +3 -1
  113. data/spec/moneta/simple_file_spec.rb +1 -0
  114. data/spec/moneta/simple_file_with_expires_spec.rb +3 -1
  115. data/spec/moneta/simple_fog_spec.rb +1 -0
  116. data/spec/moneta/simple_fog_with_expires_spec.rb +2 -1
  117. data/spec/moneta/simple_gdbm_spec.rb +1 -0
  118. data/spec/moneta/simple_gdbm_with_expires_spec.rb +3 -1
  119. data/spec/moneta/simple_hashfile_spec.rb +1 -0
  120. data/spec/moneta/simple_hashfile_with_expires_spec.rb +3 -1
  121. data/spec/moneta/simple_hbase_spec.rb +1 -0
  122. data/spec/moneta/simple_hbase_with_expires_spec.rb +3 -1
  123. data/spec/moneta/simple_leveldb_spec.rb +1 -0
  124. data/spec/moneta/simple_leveldb_with_expires_spec.rb +3 -1
  125. data/spec/moneta/simple_localmemcache_spec.rb +1 -0
  126. data/spec/moneta/simple_localmemcache_with_expires_spec.rb +2 -1
  127. data/spec/moneta/simple_lruhash_spec.rb +1 -0
  128. data/spec/moneta/simple_lruhash_with_expires_spec.rb +3 -1
  129. data/spec/moneta/simple_memcached_dalli_spec.rb +2 -0
  130. data/spec/moneta/simple_memcached_native_spec.rb +2 -0
  131. data/spec/moneta/simple_memcached_spec.rb +2 -0
  132. data/spec/moneta/simple_memory_spec.rb +1 -0
  133. data/spec/moneta/simple_memory_with_compress_spec.rb +1 -0
  134. data/spec/moneta/simple_memory_with_expires_spec.rb +3 -1
  135. data/spec/moneta/simple_memory_with_json_key_serializer_spec.rb +1 -0
  136. data/spec/moneta/simple_memory_with_json_serializer_spec.rb +1 -0
  137. data/spec/moneta/simple_memory_with_json_value_serializer_spec.rb +1 -0
  138. data/spec/moneta/simple_memory_with_prefix_spec.rb +1 -0
  139. data/spec/moneta/simple_memory_with_snappy_compress_spec.rb +1 -0
  140. data/spec/moneta/simple_mongo_spec.rb +2 -0
  141. data/spec/moneta/simple_null_spec.rb +1 -0
  142. data/spec/moneta/simple_pstore_spec.rb +1 -0
  143. data/spec/moneta/simple_pstore_with_expires_spec.rb +3 -1
  144. data/spec/moneta/simple_redis_spec.rb +2 -0
  145. data/spec/moneta/simple_restclient_spec.rb +1 -0
  146. data/spec/moneta/simple_riak_spec.rb +1 -0
  147. data/spec/moneta/simple_riak_with_expires_spec.rb +2 -1
  148. data/spec/moneta/simple_sdbm_spec.rb +1 -0
  149. data/spec/moneta/simple_sdbm_with_expires_spec.rb +3 -1
  150. data/spec/moneta/simple_sequel_spec.rb +1 -0
  151. data/spec/moneta/simple_sequel_with_expires_spec.rb +3 -1
  152. data/spec/moneta/simple_sqlite_spec.rb +1 -0
  153. data/spec/moneta/simple_sqlite_with_expires_spec.rb +3 -1
  154. data/spec/moneta/simple_tdb_spec.rb +1 -0
  155. data/spec/moneta/simple_tdb_with_expires_spec.rb +3 -1
  156. data/spec/moneta/simple_tokyocabinet_spec.rb +1 -0
  157. data/spec/moneta/simple_tokyocabinet_with_expires_spec.rb +3 -1
  158. data/spec/moneta/simple_yaml_spec.rb +1 -0
  159. data/spec/moneta/simple_yaml_with_expires_spec.rb +3 -1
  160. data/spec/moneta/stack_file_memory_spec.rb +1 -0
  161. data/spec/moneta/stack_memory_file_spec.rb +1 -0
  162. data/spec/moneta/transformer_bencode_spec.rb +1 -0
  163. data/spec/moneta/transformer_bert_spec.rb +1 -0
  164. data/spec/moneta/transformer_bson_spec.rb +1 -0
  165. data/spec/moneta/transformer_bzip2_spec.rb +1 -0
  166. data/spec/moneta/transformer_json_spec.rb +1 -0
  167. data/spec/moneta/transformer_key_inspect_spec.rb +73 -0
  168. data/spec/moneta/transformer_key_marshal_spec.rb +1 -0
  169. data/spec/moneta/transformer_key_to_s_spec.rb +1 -0
  170. data/spec/moneta/transformer_key_yaml_spec.rb +1 -0
  171. data/spec/moneta/transformer_lzma_spec.rb +1 -0
  172. data/spec/moneta/transformer_lzo_spec.rb +1 -0
  173. data/spec/moneta/transformer_marshal_base64_spec.rb +1 -0
  174. data/spec/moneta/transformer_marshal_escape_spec.rb +1 -0
  175. data/spec/moneta/transformer_marshal_hmac_spec.rb +1 -0
  176. data/spec/moneta/transformer_marshal_md5_spec.rb +1 -0
  177. data/spec/moneta/transformer_marshal_md5_spread_spec.rb +1 -0
  178. data/spec/moneta/transformer_marshal_prefix_spec.rb +1 -0
  179. data/spec/moneta/transformer_marshal_rmd160_spec.rb +1 -0
  180. data/spec/moneta/transformer_marshal_sha1_spec.rb +1 -0
  181. data/spec/moneta/transformer_marshal_sha256_spec.rb +1 -0
  182. data/spec/moneta/transformer_marshal_sha384_spec.rb +1 -0
  183. data/spec/moneta/transformer_marshal_sha512_spec.rb +1 -0
  184. data/spec/moneta/transformer_marshal_spec.rb +1 -0
  185. data/spec/moneta/transformer_marshal_truncate_spec.rb +1 -0
  186. data/spec/moneta/transformer_marshal_uuencode_spec.rb +1 -0
  187. data/spec/moneta/transformer_msgpack_spec.rb +1 -0
  188. data/spec/moneta/transformer_ox_spec.rb +1 -0
  189. data/spec/moneta/transformer_quicklz_spec.rb +1 -0
  190. data/spec/moneta/transformer_snappy_spec.rb +1 -0
  191. data/spec/moneta/transformer_tnet_spec.rb +1 -0
  192. data/spec/moneta/transformer_value_marshal_spec.rb +1 -0
  193. data/spec/moneta/transformer_value_yaml_spec.rb +1 -0
  194. data/spec/moneta/transformer_yaml_spec.rb +1 -0
  195. data/spec/moneta/transformer_zlib_spec.rb +1 -0
  196. data/spec/moneta/weak_create_spec.rb +114 -0
  197. data/spec/moneta/weak_increment_spec.rb +114 -0
  198. data/spec/monetaspecs.rb +75 -2
  199. data/spec/rack/moneta_cookies_spec.rb +1 -1
  200. metadata +20 -4
@@ -15,6 +15,7 @@ describe_moneta "null_adapter" do
15
15
  end
16
16
 
17
17
  include_context 'setup_store'
18
+ it_should_behave_like 'not_create'
18
19
  it_should_behave_like 'not_increment'
19
20
  it_should_behave_like 'not_persist'
20
21
  it_should_behave_like 'null_objectkey_objectvalue'
@@ -76,22 +76,20 @@ describe_moneta "optionmerger" do
76
76
  end
77
77
 
78
78
  it 'has method #raw' do
79
- store.raw.default_options.should == {:store=>{:raw=>true},:load=>{:raw=>true},:delete=>{:raw=>true}}
79
+ store.raw.default_options.should == {:store=>{:raw=>true},:create=>{:raw=>true},:load=>{:raw=>true},:delete=>{:raw=>true}}
80
80
  store.raw.should equal(store.raw.raw)
81
81
  end
82
82
 
83
83
  it 'has method #prefix' do
84
- store.prefix('a').default_options.should == {:store=>{:prefix=>'a'},:load=>{:prefix=>'a'},
84
+ store.prefix('a').default_options.should == {:store=>{:prefix=>'a'},:load=>{:prefix=>'a'},:create=>{:prefix=>'a'},
85
85
  :delete=>{:prefix=>'a'},:key? => {:prefix=>'a'},:increment=>{:prefix=>'a'}}
86
86
 
87
- store.prefix('a').prefix('b').default_options.should == {:store=>{:prefix=>'ab'},:load=>{:prefix=>'ab'},
87
+ store.prefix('a').prefix('b').default_options.should == {:store=>{:prefix=>'ab'},:load=>{:prefix=>'ab'},:create=>{:prefix=>'ab'},
88
88
  :delete=>{:prefix=>'ab'},:key? => {:prefix=>'ab'},:increment=>{:prefix=>'ab'}}
89
89
 
90
- store.raw.prefix('b').default_options.should == {:store=>{:raw=>true,:prefix=>'b'},:load=>{:raw=>true,:prefix=>'b'},
91
- :delete=>{:raw=>true,:prefix=>'b'},:key? => {:prefix=>'b'},:increment=>{:prefix=>'b'}}
90
+ store.raw.prefix('b').default_options.should == {:store=>{:raw=>true,:prefix=>'b'},:load=>{:raw=>true,:prefix=>'b'},:create=>{:raw=>true,:prefix=>'b'},:delete=>{:raw=>true,:prefix=>'b'},:key? => {:prefix=>'b'},:increment=>{:prefix=>'b'}}
92
91
 
93
- store.prefix('a').raw.default_options.should == {:store=>{:raw=>true,:prefix=>'a'},:load=>{:raw=>true,:prefix=>'a'},
94
- :delete=>{:raw=>true,:prefix=>'a'},:key? => {:prefix=>'a'},:increment=>{:prefix=>'a'}}
92
+ store.prefix('a').raw.default_options.should == {:store=>{:raw=>true,:prefix=>'a'},:load=>{:raw=>true,:prefix=>'a'},:create=>{:raw=>true,:prefix=>'a'},:delete=>{:raw=>true,:prefix=>'a'},:key? => {:prefix=>'a'},:increment=>{:prefix=>'a'}}
95
93
  end
96
94
 
97
95
  it 'supports adding proxis using #with' do
@@ -19,6 +19,7 @@ describe_moneta "pool" do
19
19
  end
20
20
 
21
21
  include_context 'setup_store'
22
+ it_should_behave_like 'create'
22
23
  it_should_behave_like 'increment'
23
24
  it_should_behave_like 'multiprocess'
24
25
  it_should_behave_like 'null_stringkey_stringvalue'
@@ -20,6 +20,8 @@ describe_moneta "proxy_expires_memory" do
20
20
  end
21
21
 
22
22
  include_context 'setup_store'
23
+ it_should_behave_like 'create'
24
+ it_should_behave_like 'create_expires'
23
25
  it_should_behave_like 'expires'
24
26
  it_should_behave_like 'increment'
25
27
  it_should_behave_like 'not_persist'
@@ -19,6 +19,8 @@ describe_moneta "proxy_redis" do
19
19
  end
20
20
 
21
21
  include_context 'setup_store'
22
+ it_should_behave_like 'create'
23
+ it_should_behave_like 'create_expires'
22
24
  it_should_behave_like 'expires'
23
25
  it_should_behave_like 'increment'
24
26
  it_should_behave_like 'multiprocess'
@@ -0,0 +1,84 @@
1
+ # Generated by generate-specs
2
+ require 'helper'
3
+
4
+ describe_moneta "semaphore" do
5
+ def log
6
+ @log ||= File.open(File.join(make_tempdir, 'semaphore.log'), 'a')
7
+ end
8
+
9
+ def new_store
10
+ Moneta.new(:Memory, :logger => {:out => log})
11
+ end
12
+
13
+ def load_value(value)
14
+ Marshal.load(value)
15
+ end
16
+
17
+ include_context 'setup_store'
18
+
19
+ it 'should have #lock' do
20
+ mutex = Moneta::Semaphore.new(store, 'semaphore')
21
+ mutex.lock.should be_true
22
+ mutex.locked?.should be_true
23
+ expect do
24
+ mutex.lock
25
+ end.to raise_error(RuntimeError)
26
+ expect do
27
+ mutex.try_lock
28
+ end.to raise_error(RuntimeError)
29
+ mutex.unlock.should be_nil
30
+ mutex.locked?.should be_false
31
+ end
32
+
33
+ it 'should have #enter' do
34
+ mutex = Moneta::Semaphore.new(store, 'semaphore')
35
+ mutex.enter.should be_true
36
+ mutex.locked?.should be_true
37
+ expect do
38
+ mutex.enter
39
+ end.to raise_error(RuntimeError)
40
+ expect do
41
+ mutex.try_enter
42
+ end.to raise_error(RuntimeError)
43
+ mutex.leave.should be_nil
44
+ mutex.locked?.should be_false
45
+ end
46
+
47
+ it 'should lock with #lock' do
48
+ a = Moneta::Semaphore.new(store, 'semaphore')
49
+ b = Moneta::Semaphore.new(store, 'semaphore')
50
+ a.lock.should be_true
51
+ b.try_lock.should be_false
52
+ a.unlock.should be_nil
53
+ end
54
+
55
+ it 'should have lock timeout' do
56
+ a = Moneta::Semaphore.new(store, 'semaphore')
57
+ b = Moneta::Semaphore.new(store, 'semaphore')
58
+ a.lock.should be_true
59
+ b.lock(1).should be_false
60
+ a.unlock.should be_nil
61
+ end
62
+
63
+ it 'should count concurrent accesses' do
64
+ a = Moneta::Semaphore.new(store, 'semaphore', 2)
65
+ b = Moneta::Semaphore.new(store, 'semaphore', 2)
66
+ c = Moneta::Semaphore.new(store, 'semaphore', 2)
67
+ a.synchronize do
68
+ a.locked?.should be_true
69
+ b.synchronize do
70
+ b.locked?.should be_true
71
+ c.try_lock.should be_false
72
+ end
73
+ end
74
+ end
75
+
76
+ it 'should have #synchronize' do
77
+ semaphore = Moneta::Semaphore.new(store, 'semaphore')
78
+ semaphore.synchronize do
79
+ semaphore.locked?.should be_true
80
+ end
81
+ semaphore.locked?.should be_false
82
+ end
83
+
84
+ end
@@ -1,15 +1,15 @@
1
1
  # Generated by generate-specs
2
2
  require 'helper'
3
3
 
4
- describe_moneta "shared" do
4
+ describe_moneta "shared_tcp" do
5
5
  def log
6
- @log ||= File.open(File.join(make_tempdir, 'shared.log'), 'a')
6
+ @log ||= File.open(File.join(make_tempdir, 'shared_tcp.log'), 'a')
7
7
  end
8
8
 
9
9
  def new_store
10
10
  Moneta.build do
11
11
  use(:Shared, :port => 9001) do
12
- adapter :PStore, :file => File.join(make_tempdir, 'shared')
12
+ adapter :PStore, :file => File.join(make_tempdir, 'shared_tcp')
13
13
  end
14
14
  end
15
15
  end
@@ -19,6 +19,7 @@ describe_moneta "shared" do
19
19
  end
20
20
 
21
21
  include_context 'setup_store'
22
+ it_should_behave_like 'create'
22
23
  it_should_behave_like 'increment'
23
24
  it_should_behave_like 'multiprocess'
24
25
  it_should_behave_like 'null_stringkey_stringvalue'
@@ -0,0 +1,37 @@
1
+ # Generated by generate-specs
2
+ require 'helper'
3
+
4
+ describe_moneta "shared_unix" do
5
+ def log
6
+ @log ||= File.open(File.join(make_tempdir, 'shared_unix.log'), 'a')
7
+ end
8
+
9
+ def new_store
10
+ Moneta.build do
11
+ use(:Shared, :socket => File.join(make_tempdir, 'shared_unix.socket')) do
12
+ adapter :PStore, :file => File.join(make_tempdir, 'shared_unix')
13
+ end
14
+ end
15
+ end
16
+
17
+ def load_value(value)
18
+ Marshal.load(value)
19
+ end
20
+
21
+ include_context 'setup_store'
22
+ it_should_behave_like 'create'
23
+ it_should_behave_like 'increment'
24
+ it_should_behave_like 'multiprocess'
25
+ it_should_behave_like 'null_stringkey_stringvalue'
26
+ it_should_behave_like 'persist_stringkey_stringvalue'
27
+ it_should_behave_like 'returndifferent_stringkey_stringvalue'
28
+ it_should_behave_like 'store_stringkey_stringvalue'
29
+ it 'shares values' do
30
+ store['shared_key'] = 'shared_value'
31
+ second = new_store
32
+ second.key?('shared_key').should be_true
33
+ second['shared_key'].should == 'shared_value'
34
+ second.close
35
+ end
36
+
37
+ end
@@ -15,6 +15,7 @@ describe_moneta "simple_activerecord" do
15
15
  end
16
16
 
17
17
  include_context 'setup_store'
18
+ it_should_behave_like 'create'
18
19
  it_should_behave_like 'increment'
19
20
  it_should_behave_like 'marshallable_key'
20
21
  it_should_behave_like 'marshallable_value'
@@ -15,6 +15,8 @@ describe_moneta "simple_activerecord_with_expires" do
15
15
  end
16
16
 
17
17
  include_context 'setup_store'
18
+ it_should_behave_like 'create'
19
+ it_should_behave_like 'create_expires'
18
20
  it_should_behave_like 'expires'
19
21
  it_should_behave_like 'increment'
20
22
  it_should_behave_like 'marshallable_key'
@@ -146,5 +148,5 @@ describe_moneta "simple_activerecord_with_expires" do
146
148
  it_should_behave_like 'store_integerkey_booleanvalue'
147
149
  it_should_behave_like 'store_integerkey_nilvalue'
148
150
  it_should_behave_like 'store_integerkey_integervalue'
149
- it_should_behave_like 'transform_value_with_expires'
151
+ it_should_behave_like 'transform_value_expires'
150
152
  end
@@ -19,6 +19,7 @@ describe_moneta "simple_cassandra" do
19
19
  it_should_behave_like 'marshallable_key'
20
20
  it_should_behave_like 'marshallable_value'
21
21
  it_should_behave_like 'multiprocess'
22
+ it_should_behave_like 'not_create'
22
23
  it_should_behave_like 'not_increment'
23
24
  it_should_behave_like 'null_objectkey_objectvalue'
24
25
  it_should_behave_like 'null_objectkey_stringvalue'
@@ -16,6 +16,7 @@ describe_moneta "simple_client_tcp" do
16
16
  end
17
17
 
18
18
  include_context 'setup_store'
19
+ it_should_behave_like 'create'
19
20
  it_should_behave_like 'increment'
20
21
  it_should_behave_like 'marshallable_key'
21
22
  it_should_behave_like 'marshallable_value'
@@ -6,9 +6,9 @@ describe_moneta "simple_client_unix" do
6
6
  @log ||= File.open(File.join(make_tempdir, 'simple_client_unix.log'), 'a')
7
7
  end
8
8
 
9
- start_server(Moneta::Adapters::Memory.new, :file => File.join(make_tempdir, 'simple_client_unix'))
9
+ start_server(Moneta::Adapters::Memory.new, :socket => File.join(make_tempdir, 'simple_client_unix'))
10
10
  def new_store
11
- Moneta.new(:Client, :file => File.join(make_tempdir, 'simple_client_unix'), :logger => {:out => log})
11
+ Moneta.new(:Client, :socket => File.join(make_tempdir, 'simple_client_unix'), :logger => {:out => log})
12
12
  end
13
13
 
14
14
  def load_value(value)
@@ -16,6 +16,7 @@ describe_moneta "simple_client_unix" do
16
16
  end
17
17
 
18
18
  include_context 'setup_store'
19
+ it_should_behave_like 'create'
19
20
  it_should_behave_like 'increment'
20
21
  it_should_behave_like 'marshallable_key'
21
22
  it_should_behave_like 'marshallable_value'
@@ -18,6 +18,7 @@ describe_moneta "simple_couch" do
18
18
  it_should_behave_like 'marshallable_key'
19
19
  it_should_behave_like 'marshallable_value'
20
20
  it_should_behave_like 'multiprocess'
21
+ it_should_behave_like 'not_create'
21
22
  it_should_behave_like 'not_increment'
22
23
  it_should_behave_like 'null_objectkey_objectvalue'
23
24
  it_should_behave_like 'null_objectkey_stringvalue'
@@ -19,6 +19,7 @@ describe_moneta "simple_couch_with_expires" do
19
19
  it_should_behave_like 'marshallable_key'
20
20
  it_should_behave_like 'marshallable_value'
21
21
  it_should_behave_like 'multiprocess'
22
+ it_should_behave_like 'not_create'
22
23
  it_should_behave_like 'not_increment'
23
24
  it_should_behave_like 'null_objectkey_objectvalue'
24
25
  it_should_behave_like 'null_objectkey_stringvalue'
@@ -146,5 +147,5 @@ describe_moneta "simple_couch_with_expires" do
146
147
  it_should_behave_like 'store_integerkey_booleanvalue'
147
148
  it_should_behave_like 'store_integerkey_nilvalue'
148
149
  it_should_behave_like 'store_integerkey_integervalue'
149
- it_should_behave_like 'transform_value_with_expires'
150
+ it_should_behave_like 'transform_value_expires'
150
151
  end
@@ -17,6 +17,7 @@ describe_moneta "simple_datamapper" do
17
17
  end
18
18
 
19
19
  include_context 'setup_store'
20
+ it_should_behave_like 'create'
20
21
  it_should_behave_like 'marshallable_key'
21
22
  it_should_behave_like 'marshallable_value'
22
23
  it_should_behave_like 'multiprocess'
@@ -17,6 +17,8 @@ describe_moneta "simple_datamapper_with_expires" do
17
17
  end
18
18
 
19
19
  include_context 'setup_store'
20
+ it_should_behave_like 'create'
21
+ it_should_behave_like 'create_expires'
20
22
  it_should_behave_like 'expires'
21
23
  it_should_behave_like 'marshallable_key'
22
24
  it_should_behave_like 'marshallable_value'
@@ -148,5 +150,5 @@ describe_moneta "simple_datamapper_with_expires" do
148
150
  it_should_behave_like 'store_integerkey_booleanvalue'
149
151
  it_should_behave_like 'store_integerkey_nilvalue'
150
152
  it_should_behave_like 'store_integerkey_integervalue'
151
- it_should_behave_like 'transform_value_with_expires'
153
+ it_should_behave_like 'transform_value_expires'
152
154
  end
@@ -17,6 +17,7 @@ describe_moneta "simple_datamapper_with_repository" do
17
17
  end
18
18
 
19
19
  include_context 'setup_store'
20
+ it_should_behave_like 'create'
20
21
  it_should_behave_like 'marshallable_key'
21
22
  it_should_behave_like 'marshallable_value'
22
23
  it_should_behave_like 'multiprocess'
@@ -15,6 +15,7 @@ describe_moneta "simple_daybreak" do
15
15
  end
16
16
 
17
17
  include_context 'setup_store'
18
+ it_should_behave_like 'create'
18
19
  it_should_behave_like 'increment'
19
20
  it_should_behave_like 'marshallable_key'
20
21
  it_should_behave_like 'marshallable_value'
@@ -15,6 +15,8 @@ describe_moneta "simple_daybreak_with_expires" do
15
15
  end
16
16
 
17
17
  include_context 'setup_store'
18
+ it_should_behave_like 'create'
19
+ it_should_behave_like 'create_expires'
18
20
  it_should_behave_like 'expires'
19
21
  it_should_behave_like 'increment'
20
22
  it_should_behave_like 'marshallable_key'
@@ -145,5 +147,5 @@ describe_moneta "simple_daybreak_with_expires" do
145
147
  it_should_behave_like 'store_integerkey_booleanvalue'
146
148
  it_should_behave_like 'store_integerkey_nilvalue'
147
149
  it_should_behave_like 'store_integerkey_integervalue'
148
- it_should_behave_like 'transform_value_with_expires'
150
+ it_should_behave_like 'transform_value_expires'
149
151
  end
@@ -15,6 +15,7 @@ describe_moneta "simple_dbm" do
15
15
  end
16
16
 
17
17
  include_context 'setup_store'
18
+ it_should_behave_like 'create'
18
19
  it_should_behave_like 'increment'
19
20
  it_should_behave_like 'marshallable_key'
20
21
  it_should_behave_like 'marshallable_value'
@@ -15,6 +15,8 @@ describe_moneta "simple_dbm_with_expires" do
15
15
  end
16
16
 
17
17
  include_context 'setup_store'
18
+ it_should_behave_like 'create'
19
+ it_should_behave_like 'create_expires'
18
20
  it_should_behave_like 'expires'
19
21
  it_should_behave_like 'increment'
20
22
  it_should_behave_like 'marshallable_key'
@@ -145,5 +147,5 @@ describe_moneta "simple_dbm_with_expires" do
145
147
  it_should_behave_like 'store_integerkey_booleanvalue'
146
148
  it_should_behave_like 'store_integerkey_nilvalue'
147
149
  it_should_behave_like 'store_integerkey_integervalue'
148
- it_should_behave_like 'transform_value_with_expires'
150
+ it_should_behave_like 'transform_value_expires'
149
151
  end
@@ -15,6 +15,7 @@ describe_moneta "simple_file" do
15
15
  end
16
16
 
17
17
  include_context 'setup_store'
18
+ it_should_behave_like 'create'
18
19
  it_should_behave_like 'increment'
19
20
  it_should_behave_like 'marshallable_key'
20
21
  it_should_behave_like 'marshallable_value'
@@ -15,6 +15,8 @@ describe_moneta "simple_file_with_expires" do
15
15
  end
16
16
 
17
17
  include_context 'setup_store'
18
+ it_should_behave_like 'create'
19
+ it_should_behave_like 'create_expires'
18
20
  it_should_behave_like 'expires'
19
21
  it_should_behave_like 'increment'
20
22
  it_should_behave_like 'marshallable_key'
@@ -146,5 +148,5 @@ describe_moneta "simple_file_with_expires" do
146
148
  it_should_behave_like 'store_integerkey_booleanvalue'
147
149
  it_should_behave_like 'store_integerkey_nilvalue'
148
150
  it_should_behave_like 'store_integerkey_integervalue'
149
- it_should_behave_like 'transform_value_with_expires'
151
+ it_should_behave_like 'transform_value_expires'
150
152
  end
@@ -23,6 +23,7 @@ describe_moneta "simple_fog" do
23
23
  it_should_behave_like 'marshallable_key'
24
24
  it_should_behave_like 'marshallable_value'
25
25
  it_should_behave_like 'multiprocess'
26
+ it_should_behave_like 'not_create'
26
27
  it_should_behave_like 'not_increment'
27
28
  it_should_behave_like 'null_objectkey_objectvalue'
28
29
  it_should_behave_like 'null_objectkey_stringvalue'
@@ -25,6 +25,7 @@ describe_moneta "simple_fog_with_expires" do
25
25
  it_should_behave_like 'marshallable_key'
26
26
  it_should_behave_like 'marshallable_value'
27
27
  it_should_behave_like 'multiprocess'
28
+ it_should_behave_like 'not_create'
28
29
  it_should_behave_like 'not_increment'
29
30
  it_should_behave_like 'null_objectkey_objectvalue'
30
31
  it_should_behave_like 'null_objectkey_stringvalue'
@@ -152,5 +153,5 @@ describe_moneta "simple_fog_with_expires" do
152
153
  it_should_behave_like 'store_integerkey_booleanvalue'
153
154
  it_should_behave_like 'store_integerkey_nilvalue'
154
155
  it_should_behave_like 'store_integerkey_integervalue'
155
- it_should_behave_like 'transform_value_with_expires'
156
+ it_should_behave_like 'transform_value_expires'
156
157
  end