moneta 0.7.5 → 0.7.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. data/CHANGES +6 -0
  2. data/README.md +52 -51
  3. data/Rakefile +1 -3
  4. data/lib/moneta/adapters/daybreak.rb +7 -9
  5. data/lib/moneta/adapters/file.rb +2 -2
  6. data/lib/moneta/adapters/memcached/dalli.rb +1 -0
  7. data/lib/moneta/adapters/memcached/native.rb +1 -0
  8. data/lib/moneta/transformer.rb +4 -4
  9. data/lib/moneta/transformer/config.rb +2 -1
  10. data/lib/moneta/version.rb +1 -1
  11. data/script/benchmarks +52 -44
  12. data/script/generate-specs +238 -49
  13. data/spec/helper.rb +4 -0
  14. data/spec/moneta/adapter_activerecord_spec.rb +5 -0
  15. data/spec/moneta/adapter_cassandra_spec.rb +5 -0
  16. data/spec/moneta/adapter_cassandra_with_default_expires_spec.rb +5 -0
  17. data/spec/moneta/adapter_client_spec.rb +5 -0
  18. data/spec/moneta/adapter_cookie_spec.rb +4 -0
  19. data/spec/moneta/adapter_couch_spec.rb +5 -0
  20. data/spec/moneta/adapter_datamapper_spec.rb +5 -0
  21. data/spec/moneta/adapter_daybreak_spec.rb +4 -0
  22. data/spec/moneta/adapter_dbm_spec.rb +4 -0
  23. data/spec/moneta/adapter_file_spec.rb +5 -0
  24. data/spec/moneta/adapter_fog_spec.rb +5 -0
  25. data/spec/moneta/adapter_gdbm_spec.rb +5 -0
  26. data/spec/moneta/adapter_hbase_spec.rb +5 -0
  27. data/spec/moneta/adapter_leveldb_spec.rb +4 -0
  28. data/spec/moneta/adapter_localmemcache_spec.rb +5 -0
  29. data/spec/moneta/adapter_lruhash_spec.rb +4 -0
  30. data/spec/moneta/adapter_memcached_dalli_spec.rb +5 -0
  31. data/spec/moneta/adapter_memcached_dalli_with_default_expires_spec.rb +5 -0
  32. data/spec/moneta/adapter_memcached_native_spec.rb +5 -0
  33. data/spec/moneta/adapter_memcached_native_with_default_expires_spec.rb +5 -0
  34. data/spec/moneta/adapter_memcached_spec.rb +5 -0
  35. data/spec/moneta/adapter_memcached_with_default_expires_spec.rb +5 -0
  36. data/spec/moneta/adapter_memory_spec.rb +4 -0
  37. data/spec/moneta/adapter_mongo_spec.rb +5 -0
  38. data/spec/moneta/adapter_mongo_with_default_expires_spec.rb +5 -0
  39. data/spec/moneta/adapter_pstore_spec.rb +5 -0
  40. data/spec/moneta/adapter_redis_spec.rb +5 -0
  41. data/spec/moneta/adapter_redis_with_default_expires_spec.rb +5 -0
  42. data/spec/moneta/adapter_restclient_spec.rb +5 -0
  43. data/spec/moneta/adapter_riak_spec.rb +5 -0
  44. data/spec/moneta/adapter_sdbm_spec.rb +4 -0
  45. data/spec/moneta/adapter_sequel_spec.rb +5 -0
  46. data/spec/moneta/adapter_sqlite_spec.rb +5 -0
  47. data/spec/moneta/adapter_tdb_spec.rb +4 -0
  48. data/spec/moneta/adapter_tokyocabinet_bdb_spec.rb +4 -0
  49. data/spec/moneta/adapter_tokyocabinet_hdb_spec.rb +4 -0
  50. data/spec/moneta/adapter_yaml_spec.rb +5 -0
  51. data/spec/moneta/cache_file_memory_spec.rb +5 -0
  52. data/spec/moneta/cache_memory_null_spec.rb +4 -0
  53. data/spec/moneta/expires_file_spec.rb +5 -0
  54. data/spec/moneta/expires_memory_spec.rb +4 -0
  55. data/spec/moneta/expires_memory_with_default_expires_spec.rb +4 -0
  56. data/spec/moneta/lock_spec.rb +4 -0
  57. data/spec/moneta/null_adapter_spec.rb +4 -0
  58. data/spec/moneta/optionmerger_spec.rb +5 -1
  59. data/spec/moneta/pool_spec.rb +5 -0
  60. data/spec/moneta/proxy_expires_memory_spec.rb +4 -0
  61. data/spec/moneta/proxy_redis_spec.rb +5 -0
  62. data/spec/moneta/shared_spec.rb +5 -0
  63. data/spec/moneta/simple_activerecord_spec.rb +6 -1
  64. data/spec/moneta/simple_activerecord_with_expires_spec.rb +6 -1
  65. data/spec/moneta/simple_cassandra_spec.rb +6 -1
  66. data/spec/moneta/simple_client_tcp_spec.rb +6 -1
  67. data/spec/moneta/simple_client_unix_spec.rb +6 -1
  68. data/spec/moneta/simple_couch_spec.rb +6 -1
  69. data/spec/moneta/simple_couch_with_expires_spec.rb +6 -1
  70. data/spec/moneta/simple_datamapper_spec.rb +6 -1
  71. data/spec/moneta/simple_datamapper_with_expires_spec.rb +6 -1
  72. data/spec/moneta/simple_datamapper_with_repository_spec.rb +6 -1
  73. data/spec/moneta/simple_daybreak_spec.rb +5 -1
  74. data/spec/moneta/simple_daybreak_with_expires_spec.rb +5 -1
  75. data/spec/moneta/simple_dbm_spec.rb +5 -1
  76. data/spec/moneta/simple_dbm_with_expires_spec.rb +5 -1
  77. data/spec/moneta/simple_file_spec.rb +6 -1
  78. data/spec/moneta/simple_file_with_expires_spec.rb +6 -1
  79. data/spec/moneta/simple_fog_spec.rb +6 -1
  80. data/spec/moneta/simple_fog_with_expires_spec.rb +6 -1
  81. data/spec/moneta/simple_gdbm_spec.rb +5 -1
  82. data/spec/moneta/simple_gdbm_with_expires_spec.rb +5 -1
  83. data/spec/moneta/simple_hashfile_spec.rb +6 -1
  84. data/spec/moneta/simple_hashfile_with_expires_spec.rb +6 -1
  85. data/spec/moneta/simple_hbase_spec.rb +6 -1
  86. data/spec/moneta/simple_hbase_with_expires_spec.rb +6 -1
  87. data/spec/moneta/simple_leveldb_spec.rb +5 -1
  88. data/spec/moneta/simple_leveldb_with_expires_spec.rb +5 -1
  89. data/spec/moneta/simple_localmemcache_spec.rb +6 -1
  90. data/spec/moneta/simple_localmemcache_with_expires_spec.rb +6 -1
  91. data/spec/moneta/simple_lruhash_spec.rb +5 -1
  92. data/spec/moneta/simple_lruhash_with_expires_spec.rb +5 -1
  93. data/spec/moneta/simple_memcached_dalli_spec.rb +6 -1
  94. data/spec/moneta/simple_memcached_native_spec.rb +6 -1
  95. data/spec/moneta/simple_memcached_spec.rb +6 -1
  96. data/spec/moneta/simple_memory_spec.rb +5 -1
  97. data/spec/moneta/simple_memory_with_compress_spec.rb +5 -1
  98. data/spec/moneta/simple_memory_with_expires_spec.rb +5 -1
  99. data/spec/moneta/simple_memory_with_json_key_serializer_spec.rb +5 -1
  100. data/spec/moneta/simple_memory_with_json_serializer_spec.rb +5 -1
  101. data/spec/moneta/simple_memory_with_json_value_serializer_spec.rb +5 -1
  102. data/spec/moneta/simple_memory_with_prefix_spec.rb +5 -1
  103. data/spec/moneta/simple_memory_with_snappy_compress_spec.rb +5 -1
  104. data/spec/moneta/simple_mongo_spec.rb +6 -1
  105. data/spec/moneta/simple_null_spec.rb +5 -1
  106. data/spec/moneta/simple_pstore_spec.rb +6 -1
  107. data/spec/moneta/simple_pstore_with_expires_spec.rb +6 -1
  108. data/spec/moneta/simple_redis_spec.rb +6 -1
  109. data/spec/moneta/simple_restclient_spec.rb +6 -1
  110. data/spec/moneta/simple_riak_spec.rb +6 -1
  111. data/spec/moneta/simple_riak_with_expires_spec.rb +6 -1
  112. data/spec/moneta/simple_sdbm_spec.rb +5 -1
  113. data/spec/moneta/simple_sdbm_with_expires_spec.rb +5 -1
  114. data/spec/moneta/simple_sequel_spec.rb +6 -1
  115. data/spec/moneta/simple_sequel_with_expires_spec.rb +6 -1
  116. data/spec/moneta/simple_sqlite_spec.rb +6 -1
  117. data/spec/moneta/simple_sqlite_with_expires_spec.rb +6 -1
  118. data/spec/moneta/simple_tdb_spec.rb +5 -1
  119. data/spec/moneta/simple_tdb_with_expires_spec.rb +5 -1
  120. data/spec/moneta/simple_tokyocabinet_spec.rb +5 -1
  121. data/spec/moneta/simple_tokyocabinet_with_expires_spec.rb +5 -1
  122. data/spec/moneta/simple_yaml_spec.rb +6 -1
  123. data/spec/moneta/simple_yaml_with_expires_spec.rb +6 -1
  124. data/spec/moneta/stack_file_memory_spec.rb +5 -0
  125. data/spec/moneta/stack_memory_file_spec.rb +5 -0
  126. data/spec/moneta/transformer_bencode_spec.rb +8 -0
  127. data/spec/moneta/transformer_bert_spec.rb +8 -0
  128. data/spec/moneta/transformer_bson_spec.rb +8 -0
  129. data/spec/moneta/transformer_bzip2_spec.rb +8 -0
  130. data/spec/moneta/transformer_json_spec.rb +8 -0
  131. data/spec/moneta/transformer_key_marshal_spec.rb +8 -0
  132. data/spec/moneta/transformer_key_to_s_spec.rb +72 -0
  133. data/spec/moneta/transformer_key_yaml_spec.rb +8 -0
  134. data/spec/moneta/transformer_lzma_spec.rb +8 -0
  135. data/spec/moneta/transformer_lzo_spec.rb +8 -0
  136. data/spec/moneta/transformer_marshal_base64_spec.rb +8 -0
  137. data/spec/moneta/transformer_marshal_escape_spec.rb +8 -0
  138. data/spec/moneta/transformer_marshal_hmac_spec.rb +8 -0
  139. data/spec/moneta/transformer_marshal_md5_spec.rb +8 -0
  140. data/spec/moneta/transformer_marshal_md5_spread_spec.rb +8 -0
  141. data/spec/moneta/transformer_marshal_prefix_spec.rb +8 -0
  142. data/spec/moneta/transformer_marshal_rmd160_spec.rb +8 -0
  143. data/spec/moneta/transformer_marshal_sha1_spec.rb +8 -0
  144. data/spec/moneta/transformer_marshal_sha256_spec.rb +8 -0
  145. data/spec/moneta/transformer_marshal_sha384_spec.rb +8 -0
  146. data/spec/moneta/transformer_marshal_sha512_spec.rb +8 -0
  147. data/spec/moneta/transformer_marshal_spec.rb +8 -0
  148. data/spec/moneta/transformer_marshal_truncate_spec.rb +8 -0
  149. data/spec/moneta/transformer_marshal_uuencode_spec.rb +8 -0
  150. data/spec/moneta/transformer_msgpack_spec.rb +8 -0
  151. data/spec/moneta/transformer_ox_spec.rb +8 -0
  152. data/spec/moneta/transformer_quicklz_spec.rb +8 -0
  153. data/spec/moneta/transformer_snappy_spec.rb +8 -0
  154. data/spec/moneta/transformer_tnet_spec.rb +8 -0
  155. data/spec/moneta/transformer_value_marshal_spec.rb +8 -0
  156. data/spec/moneta/transformer_value_yaml_spec.rb +8 -0
  157. data/spec/moneta/transformer_yaml_spec.rb +8 -0
  158. data/spec/moneta/transformer_zlib_spec.rb +8 -0
  159. data/spec/monetaspecs.rb +11 -0
  160. metadata +4 -2
@@ -2,9 +2,13 @@
2
2
  require 'helper'
3
3
 
4
4
  describe_moneta "simple_client_tcp" do
5
+ def log
6
+ @log ||= File.open(File.join(make_tempdir, 'simple_client_tcp.log'), 'a')
7
+ end
8
+
5
9
  start_server(Moneta::Adapters::Memory.new)
6
10
  def new_store
7
- Moneta.new(:Client, :logger => {:out => File.open(File.join(make_tempdir, 'simple_client_tcp.log'), 'a')})
11
+ Moneta.new(:Client, :logger => {:out => log})
8
12
  end
9
13
 
10
14
  def load_value(value)
@@ -15,6 +19,7 @@ describe_moneta "simple_client_tcp" do
15
19
  it_should_behave_like 'increment'
16
20
  it_should_behave_like 'marshallable_key'
17
21
  it_should_behave_like 'marshallable_value'
22
+ it_should_behave_like 'multiprocess'
18
23
  it_should_behave_like 'null_objectkey_objectvalue'
19
24
  it_should_behave_like 'null_objectkey_stringvalue'
20
25
  it_should_behave_like 'null_objectkey_hashvalue'
@@ -2,9 +2,13 @@
2
2
  require 'helper'
3
3
 
4
4
  describe_moneta "simple_client_unix" do
5
+ def log
6
+ @log ||= File.open(File.join(make_tempdir, 'simple_client_unix.log'), 'a')
7
+ end
8
+
5
9
  start_server(Moneta::Adapters::Memory.new, :file => File.join(make_tempdir, 'simple_client_unix'))
6
10
  def new_store
7
- Moneta.new(:Client, :file => File.join(make_tempdir, 'simple_client_unix'), :logger => {:out => File.open(File.join(make_tempdir, 'simple_client_unix.log'), 'a')})
11
+ Moneta.new(:Client, :file => File.join(make_tempdir, 'simple_client_unix'), :logger => {:out => log})
8
12
  end
9
13
 
10
14
  def load_value(value)
@@ -15,6 +19,7 @@ describe_moneta "simple_client_unix" do
15
19
  it_should_behave_like 'increment'
16
20
  it_should_behave_like 'marshallable_key'
17
21
  it_should_behave_like 'marshallable_value'
22
+ it_should_behave_like 'multiprocess'
18
23
  it_should_behave_like 'null_objectkey_objectvalue'
19
24
  it_should_behave_like 'null_objectkey_stringvalue'
20
25
  it_should_behave_like 'null_objectkey_hashvalue'
@@ -2,8 +2,12 @@
2
2
  require 'helper'
3
3
 
4
4
  describe_moneta "simple_couch" do
5
+ def log
6
+ @log ||= File.open(File.join(make_tempdir, 'simple_couch.log'), 'a')
7
+ end
8
+
5
9
  def new_store
6
- Moneta.new(:Couch, :db => 'simple_couch', :logger => {:out => File.open(File.join(make_tempdir, 'simple_couch.log'), 'a')})
10
+ Moneta.new(:Couch, :db => 'simple_couch', :logger => {:out => log})
7
11
  end
8
12
 
9
13
  def load_value(value)
@@ -13,6 +17,7 @@ describe_moneta "simple_couch" do
13
17
  include_context 'setup_store'
14
18
  it_should_behave_like 'marshallable_key'
15
19
  it_should_behave_like 'marshallable_value'
20
+ it_should_behave_like 'multiprocess'
16
21
  it_should_behave_like 'not_increment'
17
22
  it_should_behave_like 'null_objectkey_objectvalue'
18
23
  it_should_behave_like 'null_objectkey_stringvalue'
@@ -2,8 +2,12 @@
2
2
  require 'helper'
3
3
 
4
4
  describe_moneta "simple_couch_with_expires" do
5
+ def log
6
+ @log ||= File.open(File.join(make_tempdir, 'simple_couch_with_expires.log'), 'a')
7
+ end
8
+
5
9
  def new_store
6
- Moneta.new(:Couch, :db => 'simple_couch_with_expires', :expires => true, :logger => {:out => File.open(File.join(make_tempdir, 'simple_couch_with_expires.log'), 'a')})
10
+ Moneta.new(:Couch, :db => 'simple_couch_with_expires', :expires => true, :logger => {:out => log})
7
11
  end
8
12
 
9
13
  def load_value(value)
@@ -14,6 +18,7 @@ describe_moneta "simple_couch_with_expires" do
14
18
  it_should_behave_like 'expires'
15
19
  it_should_behave_like 'marshallable_key'
16
20
  it_should_behave_like 'marshallable_value'
21
+ it_should_behave_like 'multiprocess'
17
22
  it_should_behave_like 'not_increment'
18
23
  it_should_behave_like 'null_objectkey_objectvalue'
19
24
  it_should_behave_like 'null_objectkey_stringvalue'
@@ -2,10 +2,14 @@
2
2
  require 'helper'
3
3
 
4
4
  describe_moneta "simple_datamapper" do
5
+ def log
6
+ @log ||= File.open(File.join(make_tempdir, 'simple_datamapper.log'), 'a')
7
+ end
8
+
5
9
  require 'dm-core'
6
10
  DataMapper.setup(:default, :adapter => :in_memory)
7
11
  def new_store
8
- Moneta.new(:DataMapper, :setup => "sqlite3://#{make_tempdir}/simple_datamapper", :logger => {:out => File.open(File.join(make_tempdir, 'simple_datamapper.log'), 'a')})
12
+ Moneta.new(:DataMapper, :setup => "sqlite3://#{make_tempdir}/simple_datamapper", :logger => {:out => log})
9
13
  end
10
14
 
11
15
  def load_value(value)
@@ -15,6 +19,7 @@ describe_moneta "simple_datamapper" do
15
19
  include_context 'setup_store'
16
20
  it_should_behave_like 'marshallable_key'
17
21
  it_should_behave_like 'marshallable_value'
22
+ it_should_behave_like 'multiprocess'
18
23
  it_should_behave_like 'not_increment'
19
24
  it_should_behave_like 'null_objectkey_objectvalue'
20
25
  it_should_behave_like 'null_objectkey_stringvalue'
@@ -2,10 +2,14 @@
2
2
  require 'helper'
3
3
 
4
4
  describe_moneta "simple_datamapper_with_expires" do
5
+ def log
6
+ @log ||= File.open(File.join(make_tempdir, 'simple_datamapper_with_expires.log'), 'a')
7
+ end
8
+
5
9
  require 'dm-core'
6
10
  DataMapper.setup(:default, :adapter => :in_memory)
7
11
  def new_store
8
- Moneta.new(:DataMapper, :setup => "sqlite3://#{make_tempdir}/simple_datamapper_with_expires", :expires => true, :logger => {:out => File.open(File.join(make_tempdir, 'simple_datamapper_with_expires.log'), 'a')})
12
+ Moneta.new(:DataMapper, :setup => "sqlite3://#{make_tempdir}/simple_datamapper_with_expires", :expires => true, :logger => {:out => log})
9
13
  end
10
14
 
11
15
  def load_value(value)
@@ -16,6 +20,7 @@ describe_moneta "simple_datamapper_with_expires" do
16
20
  it_should_behave_like 'expires'
17
21
  it_should_behave_like 'marshallable_key'
18
22
  it_should_behave_like 'marshallable_value'
23
+ it_should_behave_like 'multiprocess'
19
24
  it_should_behave_like 'not_increment'
20
25
  it_should_behave_like 'null_objectkey_objectvalue'
21
26
  it_should_behave_like 'null_objectkey_stringvalue'
@@ -2,10 +2,14 @@
2
2
  require 'helper'
3
3
 
4
4
  describe_moneta "simple_datamapper_with_repository" do
5
+ def log
6
+ @log ||= File.open(File.join(make_tempdir, 'simple_datamapper_with_repository.log'), 'a')
7
+ end
8
+
5
9
  require 'dm-core'
6
10
  DataMapper.setup(:default, :adapter => :in_memory)
7
11
  def new_store
8
- Moneta.new(:DataMapper, :repository => :repo, :setup => "sqlite3://#{make_tempdir}/simple_datamapper_with_repository", :logger => {:out => File.open(File.join(make_tempdir, 'simple_datamapper_with_repository.log'), 'a')})
12
+ Moneta.new(:DataMapper, :repository => :repo, :setup => "sqlite3://#{make_tempdir}/simple_datamapper_with_repository", :logger => {:out => log})
9
13
  end
10
14
 
11
15
  def load_value(value)
@@ -15,6 +19,7 @@ describe_moneta "simple_datamapper_with_repository" do
15
19
  include_context 'setup_store'
16
20
  it_should_behave_like 'marshallable_key'
17
21
  it_should_behave_like 'marshallable_value'
22
+ it_should_behave_like 'multiprocess'
18
23
  it_should_behave_like 'not_increment'
19
24
  it_should_behave_like 'null_objectkey_objectvalue'
20
25
  it_should_behave_like 'null_objectkey_stringvalue'
@@ -2,8 +2,12 @@
2
2
  require 'helper'
3
3
 
4
4
  describe_moneta "simple_daybreak" do
5
+ def log
6
+ @log ||= File.open(File.join(make_tempdir, 'simple_daybreak.log'), 'a')
7
+ end
8
+
5
9
  def new_store
6
- Moneta.new(:Daybreak, :file => File.join(make_tempdir, "simple_daybreak"), :logger => {:out => File.open(File.join(make_tempdir, 'simple_daybreak.log'), 'a')})
10
+ Moneta.new(:Daybreak, :file => File.join(make_tempdir, "simple_daybreak"), :logger => {:out => log})
7
11
  end
8
12
 
9
13
  def load_value(value)
@@ -2,8 +2,12 @@
2
2
  require 'helper'
3
3
 
4
4
  describe_moneta "simple_daybreak_with_expires" do
5
+ def log
6
+ @log ||= File.open(File.join(make_tempdir, 'simple_daybreak_with_expires.log'), 'a')
7
+ end
8
+
5
9
  def new_store
6
- Moneta.new(:Daybreak, :file => File.join(make_tempdir, "simple_daybreak_with_expires"), :expires => true, :logger => {:out => File.open(File.join(make_tempdir, 'simple_daybreak_with_expires.log'), 'a')})
10
+ Moneta.new(:Daybreak, :file => File.join(make_tempdir, "simple_daybreak_with_expires"), :expires => true, :logger => {:out => log})
7
11
  end
8
12
 
9
13
  def load_value(value)
@@ -2,8 +2,12 @@
2
2
  require 'helper'
3
3
 
4
4
  describe_moneta "simple_dbm" do
5
+ def log
6
+ @log ||= File.open(File.join(make_tempdir, 'simple_dbm.log'), 'a')
7
+ end
8
+
5
9
  def new_store
6
- Moneta.new(:DBM, :file => File.join(make_tempdir, "simple_dbm"), :logger => {:out => File.open(File.join(make_tempdir, 'simple_dbm.log'), 'a')})
10
+ Moneta.new(:DBM, :file => File.join(make_tempdir, "simple_dbm"), :logger => {:out => log})
7
11
  end
8
12
 
9
13
  def load_value(value)
@@ -2,8 +2,12 @@
2
2
  require 'helper'
3
3
 
4
4
  describe_moneta "simple_dbm_with_expires" do
5
+ def log
6
+ @log ||= File.open(File.join(make_tempdir, 'simple_dbm_with_expires.log'), 'a')
7
+ end
8
+
5
9
  def new_store
6
- Moneta.new(:DBM, :file => File.join(make_tempdir, "simple_dbm_with_expires"), :expires => true, :logger => {:out => File.open(File.join(make_tempdir, 'simple_dbm_with_expires.log'), 'a')})
10
+ Moneta.new(:DBM, :file => File.join(make_tempdir, "simple_dbm_with_expires"), :expires => true, :logger => {:out => log})
7
11
  end
8
12
 
9
13
  def load_value(value)
@@ -2,8 +2,12 @@
2
2
  require 'helper'
3
3
 
4
4
  describe_moneta "simple_file" do
5
+ def log
6
+ @log ||= File.open(File.join(make_tempdir, 'simple_file.log'), 'a')
7
+ end
8
+
5
9
  def new_store
6
- Moneta.new(:File, :dir => File.join(make_tempdir, "simple_file"), :logger => {:out => File.open(File.join(make_tempdir, 'simple_file.log'), 'a')})
10
+ Moneta.new(:File, :dir => File.join(make_tempdir, "simple_file"), :logger => {:out => log})
7
11
  end
8
12
 
9
13
  def load_value(value)
@@ -14,6 +18,7 @@ describe_moneta "simple_file" do
14
18
  it_should_behave_like 'increment'
15
19
  it_should_behave_like 'marshallable_key'
16
20
  it_should_behave_like 'marshallable_value'
21
+ it_should_behave_like 'multiprocess'
17
22
  it_should_behave_like 'null_objectkey_objectvalue'
18
23
  it_should_behave_like 'null_objectkey_stringvalue'
19
24
  it_should_behave_like 'null_objectkey_hashvalue'
@@ -2,8 +2,12 @@
2
2
  require 'helper'
3
3
 
4
4
  describe_moneta "simple_file_with_expires" do
5
+ def log
6
+ @log ||= File.open(File.join(make_tempdir, 'simple_file_with_expires.log'), 'a')
7
+ end
8
+
5
9
  def new_store
6
- Moneta.new(:File, :dir => File.join(make_tempdir, "simple_file_with_expires"), :expires => true, :logger => {:out => File.open(File.join(make_tempdir, 'simple_file_with_expires.log'), 'a')})
10
+ Moneta.new(:File, :dir => File.join(make_tempdir, "simple_file_with_expires"), :expires => true, :logger => {:out => log})
7
11
  end
8
12
 
9
13
  def load_value(value)
@@ -15,6 +19,7 @@ describe_moneta "simple_file_with_expires" do
15
19
  it_should_behave_like 'increment'
16
20
  it_should_behave_like 'marshallable_key'
17
21
  it_should_behave_like 'marshallable_value'
22
+ it_should_behave_like 'multiprocess'
18
23
  it_should_behave_like 'null_objectkey_objectvalue'
19
24
  it_should_behave_like 'null_objectkey_stringvalue'
20
25
  it_should_behave_like 'null_objectkey_hashvalue'
@@ -2,13 +2,17 @@
2
2
  require 'helper'
3
3
 
4
4
  describe_moneta "simple_fog" do
5
+ def log
6
+ @log ||= File.open(File.join(make_tempdir, 'simple_fog.log'), 'a')
7
+ end
8
+
5
9
  require 'fog'
6
10
  Fog.mock!
7
11
  def new_store
8
12
  Moneta.new(:Fog, :aws_access_key_id => 'fake_access_key_id',
9
13
  :aws_secret_access_key => 'fake_secret_access_key',
10
14
  :provider => 'AWS',
11
- :dir => 'moneta', :logger => {:out => File.open(File.join(make_tempdir, 'simple_fog.log'), 'a')})
15
+ :dir => 'moneta', :logger => {:out => log})
12
16
  end
13
17
 
14
18
  def load_value(value)
@@ -18,6 +22,7 @@ describe_moneta "simple_fog" do
18
22
  include_context 'setup_store'
19
23
  it_should_behave_like 'marshallable_key'
20
24
  it_should_behave_like 'marshallable_value'
25
+ it_should_behave_like 'multiprocess'
21
26
  it_should_behave_like 'not_increment'
22
27
  it_should_behave_like 'null_objectkey_objectvalue'
23
28
  it_should_behave_like 'null_objectkey_stringvalue'
@@ -2,6 +2,10 @@
2
2
  require 'helper'
3
3
 
4
4
  describe_moneta "simple_fog_with_expires" do
5
+ def log
6
+ @log ||= File.open(File.join(make_tempdir, 'simple_fog_with_expires.log'), 'a')
7
+ end
8
+
5
9
  require 'fog'
6
10
  Fog.mock!
7
11
  def new_store
@@ -9,7 +13,7 @@ describe_moneta "simple_fog_with_expires" do
9
13
  :aws_secret_access_key => 'fake_secret_access_key',
10
14
  :provider => 'AWS',
11
15
  :dir => 'moneta',
12
- :expires => true, :logger => {:out => File.open(File.join(make_tempdir, 'simple_fog_with_expires.log'), 'a')})
16
+ :expires => true, :logger => {:out => log})
13
17
  end
14
18
 
15
19
  def load_value(value)
@@ -20,6 +24,7 @@ describe_moneta "simple_fog_with_expires" do
20
24
  it_should_behave_like 'expires'
21
25
  it_should_behave_like 'marshallable_key'
22
26
  it_should_behave_like 'marshallable_value'
27
+ it_should_behave_like 'multiprocess'
23
28
  it_should_behave_like 'not_increment'
24
29
  it_should_behave_like 'null_objectkey_objectvalue'
25
30
  it_should_behave_like 'null_objectkey_stringvalue'
@@ -2,8 +2,12 @@
2
2
  require 'helper'
3
3
 
4
4
  describe_moneta "simple_gdbm" do
5
+ def log
6
+ @log ||= File.open(File.join(make_tempdir, 'simple_gdbm.log'), 'a')
7
+ end
8
+
5
9
  def new_store
6
- Moneta.new(:GDBM, :file => File.join(make_tempdir, "simple_gdbm"), :logger => {:out => File.open(File.join(make_tempdir, 'simple_gdbm.log'), 'a')})
10
+ Moneta.new(:GDBM, :file => File.join(make_tempdir, "simple_gdbm"), :logger => {:out => log})
7
11
  end
8
12
 
9
13
  def load_value(value)
@@ -2,8 +2,12 @@
2
2
  require 'helper'
3
3
 
4
4
  describe_moneta "simple_gdbm_with_expires" do
5
+ def log
6
+ @log ||= File.open(File.join(make_tempdir, 'simple_gdbm_with_expires.log'), 'a')
7
+ end
8
+
5
9
  def new_store
6
- Moneta.new(:GDBM, :file => File.join(make_tempdir, "simple_gdbm_with_expires"), :expires => true, :logger => {:out => File.open(File.join(make_tempdir, 'simple_gdbm_with_expires.log'), 'a')})
10
+ Moneta.new(:GDBM, :file => File.join(make_tempdir, "simple_gdbm_with_expires"), :expires => true, :logger => {:out => log})
7
11
  end
8
12
 
9
13
  def load_value(value)
@@ -2,8 +2,12 @@
2
2
  require 'helper'
3
3
 
4
4
  describe_moneta "simple_hashfile" do
5
+ def log
6
+ @log ||= File.open(File.join(make_tempdir, 'simple_hashfile.log'), 'a')
7
+ end
8
+
5
9
  def new_store
6
- Moneta.new(:HashFile, :dir => File.join(make_tempdir, "simple_hashfile"), :logger => {:out => File.open(File.join(make_tempdir, 'simple_hashfile.log'), 'a')})
10
+ Moneta.new(:HashFile, :dir => File.join(make_tempdir, "simple_hashfile"), :logger => {:out => log})
7
11
  end
8
12
 
9
13
  def load_value(value)
@@ -14,6 +18,7 @@ describe_moneta "simple_hashfile" do
14
18
  it_should_behave_like 'increment'
15
19
  it_should_behave_like 'marshallable_key'
16
20
  it_should_behave_like 'marshallable_value'
21
+ it_should_behave_like 'multiprocess'
17
22
  it_should_behave_like 'null_objectkey_objectvalue'
18
23
  it_should_behave_like 'null_objectkey_stringvalue'
19
24
  it_should_behave_like 'null_objectkey_hashvalue'
@@ -2,8 +2,12 @@
2
2
  require 'helper'
3
3
 
4
4
  describe_moneta "simple_hashfile_with_expires" do
5
+ def log
6
+ @log ||= File.open(File.join(make_tempdir, 'simple_hashfile_with_expires.log'), 'a')
7
+ end
8
+
5
9
  def new_store
6
- Moneta.new(:HashFile, :dir => File.join(make_tempdir, "simple_hashfile_with_expires"), :expires => true, :logger => {:out => File.open(File.join(make_tempdir, 'simple_hashfile_with_expires.log'), 'a')})
10
+ Moneta.new(:HashFile, :dir => File.join(make_tempdir, "simple_hashfile_with_expires"), :expires => true, :logger => {:out => log})
7
11
  end
8
12
 
9
13
  def load_value(value)
@@ -15,6 +19,7 @@ describe_moneta "simple_hashfile_with_expires" do
15
19
  it_should_behave_like 'increment'
16
20
  it_should_behave_like 'marshallable_key'
17
21
  it_should_behave_like 'marshallable_value'
22
+ it_should_behave_like 'multiprocess'
18
23
  it_should_behave_like 'null_objectkey_objectvalue'
19
24
  it_should_behave_like 'null_objectkey_stringvalue'
20
25
  it_should_behave_like 'null_objectkey_hashvalue'
@@ -2,8 +2,12 @@
2
2
  require 'helper'
3
3
 
4
4
  describe_moneta "simple_hbase" do
5
+ def log
6
+ @log ||= File.open(File.join(make_tempdir, 'simple_hbase.log'), 'a')
7
+ end
8
+
5
9
  def new_store
6
- Moneta.new(:HBase, :table => "simple_hbase", :logger => {:out => File.open(File.join(make_tempdir, 'simple_hbase.log'), 'a')})
10
+ Moneta.new(:HBase, :table => "simple_hbase", :logger => {:out => log})
7
11
  end
8
12
 
9
13
  def load_value(value)
@@ -14,6 +18,7 @@ describe_moneta "simple_hbase" do
14
18
  it_should_behave_like 'increment'
15
19
  it_should_behave_like 'marshallable_key'
16
20
  it_should_behave_like 'marshallable_value'
21
+ it_should_behave_like 'multiprocess'
17
22
  it_should_behave_like 'null_objectkey_objectvalue'
18
23
  it_should_behave_like 'null_objectkey_stringvalue'
19
24
  it_should_behave_like 'null_objectkey_hashvalue'
@@ -2,8 +2,12 @@
2
2
  require 'helper'
3
3
 
4
4
  describe_moneta "simple_hbase_with_expires" do
5
+ def log
6
+ @log ||= File.open(File.join(make_tempdir, 'simple_hbase_with_expires.log'), 'a')
7
+ end
8
+
5
9
  def new_store
6
- Moneta.new(:HBase, :table => "simple_hbase", :expires => true, :logger => {:out => File.open(File.join(make_tempdir, 'simple_hbase_with_expires.log'), 'a')})
10
+ Moneta.new(:HBase, :table => "simple_hbase", :expires => true, :logger => {:out => log})
7
11
  end
8
12
 
9
13
  def load_value(value)
@@ -15,6 +19,7 @@ describe_moneta "simple_hbase_with_expires" do
15
19
  it_should_behave_like 'increment'
16
20
  it_should_behave_like 'marshallable_key'
17
21
  it_should_behave_like 'marshallable_value'
22
+ it_should_behave_like 'multiprocess'
18
23
  it_should_behave_like 'null_objectkey_objectvalue'
19
24
  it_should_behave_like 'null_objectkey_stringvalue'
20
25
  it_should_behave_like 'null_objectkey_hashvalue'
@@ -2,8 +2,12 @@
2
2
  require 'helper'
3
3
 
4
4
  describe_moneta "simple_leveldb" do
5
+ def log
6
+ @log ||= File.open(File.join(make_tempdir, 'simple_leveldb.log'), 'a')
7
+ end
8
+
5
9
  def new_store
6
- Moneta.new(:LevelDB, :dir => File.join(make_tempdir, "simple_leveldb"), :logger => {:out => File.open(File.join(make_tempdir, 'simple_leveldb.log'), 'a')})
10
+ Moneta.new(:LevelDB, :dir => File.join(make_tempdir, "simple_leveldb"), :logger => {:out => log})
7
11
  end
8
12
 
9
13
  def load_value(value)