moneta 0.7.8 → 0.7.9

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