moneta 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.rubocop.yml +1 -1
  4. data/.travis.yml +10 -4
  5. data/CHANGES +9 -0
  6. data/Gemfile +7 -5
  7. data/README.md +9 -6
  8. data/feature_matrix.yaml +2 -1
  9. data/lib/moneta/adapters/client.rb +56 -19
  10. data/lib/moneta/adapters/couch.rb +5 -0
  11. data/lib/moneta/adapters/mongo/moped.rb +4 -1
  12. data/lib/moneta/builder.rb +2 -2
  13. data/lib/moneta/lock.rb +6 -1
  14. data/lib/moneta/pool.rb +12 -0
  15. data/lib/moneta/proxy.rb +1 -1
  16. data/lib/moneta/server.rb +215 -61
  17. data/lib/moneta/shared.rb +13 -7
  18. data/lib/moneta/transformer.rb +50 -8
  19. data/lib/moneta/transformer/config.rb +59 -40
  20. data/lib/moneta/version.rb +1 -1
  21. data/moneta.gemspec +2 -2
  22. data/script/benchmarks +6 -1
  23. data/script/contributors +1 -2
  24. data/script/start-couchdb +27 -0
  25. data/script/start-hbase +2 -2
  26. data/script/start-services +3 -3
  27. data/spec/features/store.rb +3 -3
  28. data/spec/features/transform_value.rb +27 -21
  29. data/spec/helper.rb +52 -53
  30. data/spec/moneta/adapters/activerecord/standard_activerecord_spec.rb +1 -1
  31. data/spec/moneta/adapters/activerecord/standard_activerecord_with_expires_spec.rb +1 -1
  32. data/spec/moneta/adapters/cassandra/standard_cassandra_spec.rb +1 -1
  33. data/spec/moneta/adapters/client/adapter_client_spec.rb +6 -6
  34. data/spec/moneta/adapters/client/client_helper.rb +24 -0
  35. data/spec/moneta/adapters/client/standard_client_tcp_spec.rb +8 -8
  36. data/spec/moneta/adapters/client/standard_client_unix_spec.rb +23 -7
  37. data/spec/moneta/adapters/couch/adapter_couch_spec.rb +1 -1
  38. data/spec/moneta/adapters/couch/standard_couch_spec.rb +2 -2
  39. data/spec/moneta/adapters/couch/standard_couch_with_expires_spec.rb +2 -2
  40. data/spec/moneta/adapters/daybreak/standard_daybreak_spec.rb +1 -1
  41. data/spec/moneta/adapters/daybreak/standard_daybreak_with_expires_spec.rb +1 -1
  42. data/spec/moneta/adapters/dbm/standard_dbm_spec.rb +1 -1
  43. data/spec/moneta/adapters/dbm/standard_dbm_with_expires_spec.rb +1 -1
  44. data/spec/moneta/adapters/file/standard_file_spec.rb +2 -2
  45. data/spec/moneta/adapters/file/standard_file_with_expires_spec.rb +1 -1
  46. data/spec/moneta/adapters/gdbm/standard_gdbm_spec.rb +1 -1
  47. data/spec/moneta/adapters/gdbm/standard_gdbm_with_expires_spec.rb +1 -1
  48. data/spec/moneta/adapters/kyotocabinet/adapter_kyotocabinet_spec.rb +1 -1
  49. data/spec/moneta/adapters/kyotocabinet/standard_kyotocabinet_spec.rb +2 -2
  50. data/spec/moneta/adapters/kyotocabinet/standard_kyotocabinet_with_expires_spec.rb +2 -2
  51. data/spec/moneta/adapters/leveldb/standard_leveldb_spec.rb +1 -1
  52. data/spec/moneta/adapters/leveldb/standard_leveldb_with_expires_spec.rb +1 -1
  53. data/spec/moneta/adapters/lmdb/standard_lmdb_spec.rb +1 -1
  54. data/spec/moneta/adapters/lmdb/standard_lmdb_with_expires_spec.rb +1 -1
  55. data/spec/moneta/adapters/lruhash/standard_lruhash_spec.rb +1 -1
  56. data/spec/moneta/adapters/lruhash/standard_lruhash_with_expires_spec.rb +1 -1
  57. data/spec/moneta/adapters/memory/standard_memory_spec.rb +1 -1
  58. data/spec/moneta/adapters/memory/standard_memory_with_compress_spec.rb +1 -1
  59. data/spec/moneta/adapters/memory/standard_memory_with_expires_spec.rb +1 -1
  60. data/spec/moneta/adapters/memory/standard_memory_with_json_key_serializer_spec.rb +1 -1
  61. data/spec/moneta/adapters/memory/standard_memory_with_json_serializer_spec.rb +1 -1
  62. data/spec/moneta/adapters/memory/standard_memory_with_json_value_serializer_spec.rb +2 -2
  63. data/spec/moneta/adapters/memory/standard_memory_with_prefix_spec.rb +39 -2
  64. data/spec/moneta/adapters/memory/standard_memory_with_snappy_compress_spec.rb +2 -2
  65. data/spec/moneta/adapters/mongo/adapter_mongo_moped_spec.rb +4 -3
  66. data/spec/moneta/adapters/mongo/adapter_mongo_moped_with_default_expires_spec.rb +5 -3
  67. data/spec/moneta/adapters/mongo/adapter_mongo_official_spec.rb +4 -2
  68. data/spec/moneta/adapters/mongo/adapter_mongo_official_with_default_expires_spec.rb +5 -3
  69. data/spec/moneta/adapters/mongo/adapter_mongo_spec.rb +3 -2
  70. data/spec/moneta/adapters/mongo/adapter_mongo_with_default_expires_spec.rb +5 -3
  71. data/spec/moneta/adapters/mongo/standard_mongo_moped_spec.rb +2 -2
  72. data/spec/moneta/adapters/mongo/standard_mongo_official_spec.rb +2 -2
  73. data/spec/moneta/adapters/mongo/standard_mongo_spec.rb +2 -2
  74. data/spec/moneta/adapters/pstore/standard_pstore_spec.rb +1 -1
  75. data/spec/moneta/adapters/pstore/standard_pstore_with_expires_spec.rb +1 -1
  76. data/spec/moneta/adapters/redis/standard_redis_spec.rb +1 -1
  77. data/spec/moneta/adapters/sdbm/standard_sdbm_spec.rb +1 -1
  78. data/spec/moneta/adapters/sdbm/standard_sdbm_with_expires_spec.rb +1 -1
  79. data/spec/moneta/adapters/sequel/standard_sequel_spec.rb +1 -1
  80. data/spec/moneta/adapters/sequel/standard_sequel_with_expires_spec.rb +1 -1
  81. data/spec/moneta/adapters/sqlite/standard_sqlite_spec.rb +1 -1
  82. data/spec/moneta/adapters/sqlite/standard_sqlite_with_expires_spec.rb +1 -1
  83. data/spec/moneta/adapters/tdb/standard_tdb_spec.rb +1 -1
  84. data/spec/moneta/adapters/tdb/standard_tdb_with_expires_spec.rb +1 -1
  85. data/spec/moneta/adapters/tokyocabinet/standard_tokyocabinet_spec.rb +1 -1
  86. data/spec/moneta/adapters/tokyocabinet/standard_tokyocabinet_with_expires_spec.rb +1 -1
  87. data/spec/moneta/adapters/yaml/standard_yaml_spec.rb +1 -1
  88. data/spec/moneta/adapters/yaml/standard_yaml_with_expires_spec.rb +1 -1
  89. data/spec/moneta/builder_spec.rb +22 -0
  90. data/spec/moneta/proxies/expires/expires_file_spec.rb +1 -1
  91. data/spec/moneta/proxies/shared/shared_tcp_spec.rb +14 -4
  92. data/spec/moneta/proxies/shared/shared_unix_spec.rb +4 -4
  93. data/spec/moneta/proxies/transformer/transformer_bencode_spec.rb +1 -1
  94. data/spec/moneta/proxies/transformer/transformer_bert_spec.rb +3 -3
  95. data/spec/moneta/proxies/transformer/transformer_bson_spec.rb +2 -2
  96. data/spec/moneta/proxies/transformer/transformer_json_spec.rb +1 -1
  97. data/spec/moneta/proxies/transformer/transformer_key_marshal_spec.rb +1 -1
  98. data/spec/moneta/proxies/transformer/transformer_key_yaml_spec.rb +1 -1
  99. data/spec/moneta/proxies/transformer/transformer_marshal_base64_spec.rb +1 -1
  100. data/spec/moneta/proxies/transformer/transformer_marshal_escape_spec.rb +1 -1
  101. data/spec/moneta/proxies/transformer/transformer_marshal_hex_spec.rb +1 -1
  102. data/spec/moneta/proxies/transformer/transformer_marshal_hmac_spec.rb +1 -1
  103. data/spec/moneta/proxies/transformer/transformer_marshal_prefix_base64_spec.rb +33 -0
  104. data/spec/moneta/proxies/transformer/transformer_marshal_prefix_spec.rb +1 -1
  105. data/spec/moneta/proxies/transformer/transformer_marshal_qp_spec.rb +1 -1
  106. data/spec/moneta/proxies/transformer/transformer_marshal_spec.rb +1 -1
  107. data/spec/moneta/proxies/transformer/transformer_marshal_urlsafe_base64_spec.rb +1 -1
  108. data/spec/moneta/proxies/transformer/transformer_marshal_uuencode_spec.rb +1 -1
  109. data/spec/moneta/proxies/transformer/transformer_msgpack_spec.rb +1 -1
  110. data/spec/moneta/proxies/transformer/transformer_ox_spec.rb +1 -1
  111. data/spec/moneta/proxies/transformer/transformer_php_spec.rb +1 -1
  112. data/spec/moneta/proxies/transformer/transformer_tnet_spec.rb +1 -1
  113. data/spec/moneta/proxies/transformer/transformer_yaml_spec.rb +2 -2
  114. data/spec/moneta/proxies/weak_each_key/weak_each_key_spec.rb +0 -2
  115. data/spec/support/mongo_helper.rb +12 -0
  116. metadata +18 -12
  117. data/script/reconfigure-couchdb +0 -13
@@ -3,5 +3,5 @@ describe 'standard_dbm', unsupported: defined?(JRUBY_VERSION), adapter: :DBM do
3
3
  {file: File.join(tempdir, "simple_dbm")}
4
4
  end
5
5
 
6
- moneta_specs STANDARD_SPECS.without_multiprocess
6
+ moneta_specs STANDARD_SPECS.without_multiprocess.with_each_key
7
7
  end
@@ -8,5 +8,5 @@ describe 'standard_dbm_with_expires', unsupported: defined?(JRUBY_VERSION), adap
8
8
  expires: true }
9
9
  end
10
10
 
11
- moneta_specs STANDARD_SPECS.without_multiprocess.with_expires
11
+ moneta_specs STANDARD_SPECS.without_multiprocess.with_expires.with_each_key
12
12
  end
@@ -2,6 +2,6 @@ describe 'standard_file', adapter: :File do
2
2
  moneta_store :File do
3
3
  {dir: File.join(tempdir, "simple_file")}
4
4
  end
5
-
6
- moneta_specs STANDARD_SPECS
5
+
6
+ moneta_specs STANDARD_SPECS.with_each_key
7
7
  end
@@ -7,5 +7,5 @@ describe 'standard_file_with_expires', adapter: :File do
7
7
  {dir: File.join(tempdir, "simple_file_with_expires"), expires: true}
8
8
  end
9
9
 
10
- moneta_specs STANDARD_SPECS.with_expires
10
+ moneta_specs STANDARD_SPECS.with_expires.with_each_key
11
11
  end
@@ -3,5 +3,5 @@ describe 'standard_gdbm', adapter: :GDBM do
3
3
  {file: File.join(tempdir, "simple_gdbm")}
4
4
  end
5
5
 
6
- moneta_specs STANDARD_SPECS.without_multiprocess
6
+ moneta_specs STANDARD_SPECS.without_multiprocess.with_each_key
7
7
  end
@@ -7,5 +7,5 @@ describe 'standard_gdbm_with_expires', adapter: :GDBM do
7
7
  {file: File.join(tempdir, "simple_gdbm_with_expires"), expires: true}
8
8
  end
9
9
 
10
- moneta_specs STANDARD_SPECS.without_multiprocess.with_expires
10
+ moneta_specs STANDARD_SPECS.without_multiprocess.with_expires.with_each_key
11
11
  end
@@ -1,4 +1,4 @@
1
- describe 'adapter_kyotocabinet', unsupported: defined?(JRUBY_VERSION), adapter: :KyotoCabinet do
1
+ describe 'adapter_kyotocabinet', unsupported: defined?(JRUBY_VERSION) || ::Gem::Version.new(RUBY_ENGINE_VERSION) >= ::Gem::Version.new('2.7.0'), adapter: :KyotoCabinet do
2
2
  moneta_build do
3
3
  Moneta::Adapters::KyotoCabinet.new(file: File.join(tempdir, "adapter_kyotocabinet.kch"))
4
4
  end
@@ -1,7 +1,7 @@
1
- describe 'standard_kyotocabinet', unsupported: defined?(JRUBY_VERSION), adapter: :KyotoCabinet do
1
+ describe 'standard_kyotocabinet', unsupported: defined?(JRUBY_VERSION) || ::Gem::Version.new(RUBY_ENGINE_VERSION) >= ::Gem::Version.new('2.7.0'), adapter: :KyotoCabinet do
2
2
  moneta_store :KyotoCabinet do
3
3
  {file: File.join(tempdir, "simple_kyotocabinet.kch")}
4
4
  end
5
5
 
6
- moneta_specs STANDARD_SPECS.without_multiprocess
6
+ moneta_specs STANDARD_SPECS.without_multiprocess.with_each_key
7
7
  end
@@ -1,4 +1,4 @@
1
- describe 'standard_kyotocabinet_with_expires', unsupported: defined?(JRUBY_VERSION), adapter: :KyotoCabinet do
1
+ describe 'standard_kyotocabinet_with_expires', unsupported: defined?(JRUBY_VERSION)|| ::Gem::Version.new(RUBY_ENGINE_VERSION) >= ::Gem::Version.new('2.7.0'), adapter: :KyotoCabinet do
2
2
  let(:t_res) { 0.125 }
3
3
  let(:min_ttl) { t_res }
4
4
  use_timecop
@@ -10,5 +10,5 @@ describe 'standard_kyotocabinet_with_expires', unsupported: defined?(JRUBY_VERSI
10
10
  }
11
11
  end
12
12
 
13
- moneta_specs STANDARD_SPECS.without_multiprocess.with_expires
13
+ moneta_specs STANDARD_SPECS.without_multiprocess.with_expires.with_each_key
14
14
  end
@@ -3,5 +3,5 @@ describe 'standard_leveldb', unsupported: defined?(JRUBY_VERSION), adapter: :Lev
3
3
  {dir: File.join(tempdir, "standard_leveldb")}
4
4
  end
5
5
 
6
- moneta_specs STANDARD_SPECS.without_multiprocess
6
+ moneta_specs STANDARD_SPECS.without_multiprocess.with_each_key
7
7
  end
@@ -7,5 +7,5 @@ describe 'standard_leveldb_with_expires', unsupported: defined?(JRUBY_VERSION),
7
7
  {dir: File.join(tempdir, "standard_leveldb_with_expires"), expires: true}
8
8
  end
9
9
 
10
- moneta_specs STANDARD_SPECS.without_multiprocess.with_expires
10
+ moneta_specs STANDARD_SPECS.without_multiprocess.with_expires.with_each_key
11
11
  end
@@ -3,5 +3,5 @@ describe 'standard_lmdb', unsupported: defined?(JRUBY_VERSION), adapter: :LMDB d
3
3
  {dir: File.join(tempdir, "simple_lmdb")}
4
4
  end
5
5
 
6
- moneta_specs STANDARD_SPECS.without_concurrent
6
+ moneta_specs STANDARD_SPECS.without_concurrent.with_each_key
7
7
  end
@@ -7,5 +7,5 @@ describe 'standard_lmdb_with_expires', unsupported: defined?(JRUBY_VERSION), ada
7
7
  {dir: File.join(tempdir, "simple_lmdb_with_expires"), expires: true}
8
8
  end
9
9
 
10
- moneta_specs STANDARD_SPECS.without_concurrent.with_expires
10
+ moneta_specs STANDARD_SPECS.without_concurrent.with_expires.with_each_key
11
11
  end
@@ -1,4 +1,4 @@
1
1
  describe 'standard_lruhash', adapter: :LRUHash do
2
2
  moneta_store :LRUHash
3
- moneta_specs STANDARD_SPECS.without_persist
3
+ moneta_specs STANDARD_SPECS.without_persist.with_each_key
4
4
  end
@@ -4,5 +4,5 @@ describe 'standard_lruhash_with_expires', adapter: :LRUHash do
4
4
  use_timecop
5
5
 
6
6
  moneta_store :LRUHash, {expires: true}
7
- moneta_specs STANDARD_SPECS.with_expires.without_persist
7
+ moneta_specs STANDARD_SPECS.with_expires.without_persist.with_each_key
8
8
  end
@@ -1,4 +1,4 @@
1
1
  describe 'standard_memory', adapter: :Memory do
2
2
  moneta_store :Memory
3
- moneta_specs STANDARD_SPECS.without_persist
3
+ moneta_specs STANDARD_SPECS.without_persist.with_each_key
4
4
  end
@@ -5,5 +5,5 @@ describe 'standard_memory_with_compress', adapter: :Memory do
5
5
  Marshal.load(::Zlib::Inflate.inflate(value))
6
6
  end
7
7
 
8
- moneta_specs STANDARD_SPECS.without_persist
8
+ moneta_specs STANDARD_SPECS.without_persist.with_each_key
9
9
  end
@@ -4,5 +4,5 @@ describe 'standard_memory_with_expires', adapter: :Memory do
4
4
  use_timecop
5
5
 
6
6
  moneta_store :Memory, {expires: true}
7
- moneta_specs STANDARD_SPECS.with_expires.without_persist
7
+ moneta_specs STANDARD_SPECS.with_expires.without_persist.with_each_key
8
8
  end
@@ -1,4 +1,4 @@
1
1
  describe 'standard_memory_with_json_key_serializer', adapter: :Memory do
2
2
  moneta_store :Memory, {key_serializer: :json}
3
- moneta_specs STANDARD_SPECS.without_marshallable_key.simplekeys_only.without_persist
3
+ moneta_specs STANDARD_SPECS.without_marshallable_key.simplekeys_only.without_persist.with_each_key
4
4
  end
@@ -5,5 +5,5 @@ describe 'standard_memory_with_json_serializer', adapter: :Memory do
5
5
  ::MultiJson.load(value)
6
6
  end
7
7
 
8
- moneta_specs STANDARD_SPECS.without_marshallable.simplekeys_only.simplevalues_only.without_persist
8
+ moneta_specs STANDARD_SPECS.without_marshallable.simplekeys_only.simplevalues_only.without_persist.with_each_key
9
9
  end
@@ -4,6 +4,6 @@ describe 'standard_memory_with_json_value_serializer', adapter: :Memory do
4
4
  moneta_loader do |value|
5
5
  ::MultiJson.load(value)
6
6
  end
7
-
8
- moneta_specs STANDARD_SPECS.without_marshallable_value.simplevalues_only.without_persist
7
+
8
+ moneta_specs STANDARD_SPECS.without_marshallable_value.simplevalues_only.without_persist.with_each_key
9
9
  end
@@ -1,4 +1,41 @@
1
1
  describe 'standard_memory_with_prefix', adapter: :Memory do
2
- moneta_store :Memory, {prefix: "moneta"}
3
- moneta_specs STANDARD_SPECS.without_persist
2
+ moneta_store :Memory, { prefix: "moneta" }
3
+ moneta_specs STANDARD_SPECS.without_persist.with_each_key
4
+
5
+ context 'with keys from no prefix' do
6
+ before(:each) do
7
+ store.adapter.adapter.backend['no_prefix'] = 'hidden'
8
+ end
9
+
10
+ after(:each) do
11
+ expect(store.adapter.adapter.backend.keys).to include('no_prefix')
12
+ end
13
+
14
+ include_examples :each_key
15
+ end
16
+
17
+ context 'with keys from other prefixes' do
18
+ before do
19
+ backend = store.adapter.adapter.backend
20
+ @alternative_store ||= Moneta.build do
21
+ use :Transformer, key: [:marshal, :prefix], value: :marshal, prefix: 'alternative_'
22
+ adapter :Memory, backend: backend
23
+ end
24
+ expect(@alternative_store).to be_a(Moneta::Transformer::MarshalPrefixKeyMarshalValue)
25
+ end
26
+ let(:alternative) { @alternative_store }
27
+
28
+ before(:each) do
29
+ alternative.store('with_prefix_key', 'hidden')
30
+ end
31
+
32
+ after(:each) do
33
+ expect(store.adapter.adapter.backend.keys).to include('alternative_with_prefix_key')
34
+ expect(alternative.each_key.to_a).to eq(['with_prefix_key'])
35
+ expect(alternative['with_prefix_key']).to eq('hidden')
36
+ end
37
+
38
+ include_examples :each_key
39
+ end
40
+
4
41
  end
@@ -4,6 +4,6 @@ describe 'standard_memory_with_snappy_compress', unstable: defined?(JRUBY_VERSIO
4
4
  moneta_loader do |value|
5
5
  Marshal.load(::Snappy.inflate(value))
6
6
  end
7
-
8
- moneta_specs STANDARD_SPECS.without_persist
7
+
8
+ moneta_specs STANDARD_SPECS.without_persist.with_each_key
9
9
  end
@@ -3,13 +3,14 @@ describe 'adapter_mongo_moped', adapter: :Mongo do
3
3
  let(:min_ttl) { t_res }
4
4
 
5
5
  moneta_build do
6
- Moneta::Adapters::MongoMoped.new(db: "adapter_mongo",
7
- collection: 'moped')
6
+ Moneta::Adapters::MongoMoped.new(mongo_config(
7
+ db: File.basename(__FILE__, '.rb'), collection: 'moped'
8
+ ))
8
9
  end
9
10
 
10
11
  moneta_specs ADAPTER_SPECS.with_each_key.with_native_expires.simplevalues_only
11
12
 
12
- it 'automatically deletes expired document' do
13
+ it 'automatically deletes expired document', unsupported: true do
13
14
  store.store('key', 'val', expires: 5)
14
15
 
15
16
  i = 0
@@ -3,9 +3,11 @@ describe 'adapter_mongo_moped_with_default_expires', isolate: true, adapter: :Mo
3
3
  let(:min_ttl) { t_res }
4
4
 
5
5
  moneta_build do
6
- Moneta::Adapters::MongoMoped.new(db: "adapter_mongo",
7
- collection: 'moped_with_default_expires',
8
- expires: min_ttl)
6
+ Moneta::Adapters::MongoMoped.new(mongo_config(
7
+ db: File.basename(__FILE__, '.rb'),
8
+ collection: 'moped_with_default_expires',
9
+ expires: min_ttl
10
+ ))
9
11
  end
10
12
 
11
13
  moneta_specs ADAPTER_SPECS.with_each_key.with_expires.with_default_expires.simplevalues_only
@@ -3,8 +3,10 @@ describe 'adapter_mongo_official', adapter: :Mongo do
3
3
  let(:min_ttl) { t_res }
4
4
 
5
5
  moneta_build do
6
- Moneta::Adapters::MongoOfficial.new(db: "adapter_mongo",
7
- collection: 'official')
6
+ Moneta::Adapters::MongoOfficial.new(mongo_config(
7
+ db: File.basename(__FILE__, '.rb'),
8
+ collection: 'official'
9
+ ))
8
10
  end
9
11
 
10
12
  moneta_specs ADAPTER_SPECS.with_each_key.with_native_expires.simplevalues_only
@@ -3,9 +3,11 @@ describe 'adapter_mongo_official_with_default_expires', isolate: true, adapter:
3
3
  let(:min_ttl) { t_res }
4
4
 
5
5
  moneta_build do
6
- Moneta::Adapters::MongoOfficial.new(db: "adapter_mongo",
7
- collection: 'official_with_default_expires',
8
- expires: min_ttl)
6
+ Moneta::Adapters::MongoOfficial.new(mongo_config(
7
+ db: File.basename(__FILE__, '.rb'),
8
+ collection: 'official_with_default_expires',
9
+ expires: min_ttl
10
+ ))
9
11
  end
10
12
 
11
13
  moneta_specs ADAPTER_SPECS.with_each_key.with_expires.with_default_expires.simplevalues_only
@@ -3,8 +3,9 @@ describe 'adapter_mongo', adapter: :Mongo do
3
3
  let(:min_ttl) { t_res }
4
4
 
5
5
  moneta_build do
6
- Moneta::Adapters::Mongo.new(db: "adapter_mongo",
7
- collection: 'default')
6
+ Moneta::Adapters::Mongo.new(mongo_config(
7
+ db: File.basename(__FILE__, '.rb'), collection: 'default'
8
+ ))
8
9
  end
9
10
 
10
11
  moneta_specs ADAPTER_SPECS.with_each_key.with_native_expires.simplevalues_only
@@ -3,9 +3,11 @@ describe 'adapter_mongo_with_default_expires', isolate: true, adapter: :Mongo do
3
3
  let(:min_ttl) { t_res }
4
4
 
5
5
  moneta_build do
6
- Moneta::Adapters::Mongo.new(db: "adapter_mongo",
7
- collection: 'with_default_expires',
8
- expires: min_ttl)
6
+ Moneta::Adapters::Mongo.new(mongo_config(
7
+ db: File.basename(__FILE__, '.rb'),
8
+ collection: 'with_default_expires',
9
+ expires: min_ttl
10
+ ))
9
11
  end
10
12
 
11
13
  moneta_specs ADAPTER_SPECS.with_each_key.with_expires.with_default_expires.simplevalues_only
@@ -2,6 +2,6 @@ describe 'standard_mongo_moped', adapter: :Mongo do
2
2
  let(:t_res) { 0.125 }
3
3
  let(:min_ttl) { t_res }
4
4
 
5
- moneta_store :MongoMoped, {db: 'standard_mongo', collection: 'moped'}
6
- moneta_specs STANDARD_SPECS.with_native_expires
5
+ moneta_store :MongoMoped, MongoHelper::mongo_config(db: File.basename(__FILE__, '.rb'), collection: 'moped')
6
+ moneta_specs STANDARD_SPECS.with_native_expires.with_each_key
7
7
  end
@@ -2,6 +2,6 @@ describe 'standard_mongo_official', adapter: :Mongo do
2
2
  let(:t_res) { 0.125 }
3
3
  let(:min_ttl) { t_res }
4
4
 
5
- moneta_store :MongoOfficial, {db: 'standard_mongo', collection: 'official'}
6
- moneta_specs STANDARD_SPECS.with_native_expires
5
+ moneta_store :MongoOfficial, MongoHelper::mongo_config(db: File.basename(__FILE__, '.rb'), collection: 'official')
6
+ moneta_specs STANDARD_SPECS.with_native_expires.with_each_key
7
7
  end
@@ -2,6 +2,6 @@ describe 'standard_mongo', adapter: :Mongo do
2
2
  let(:t_res) { 0.125 }
3
3
  let(:min_ttl) { t_res }
4
4
 
5
- moneta_store :Mongo, {db: 'standard_mongo', collection: 'default'}
6
- moneta_specs STANDARD_SPECS.with_native_expires
5
+ moneta_store :Mongo, MongoHelper::mongo_config(db: File.basename(__FILE__, '.rb'), collection: 'default')
6
+ moneta_specs STANDARD_SPECS.with_native_expires.with_each_key
7
7
  end
@@ -5,5 +5,5 @@ describe 'standard_pstore', unsupported: defined?(JRUBY_VERSION), adapter: :PSto
5
5
 
6
6
  moneta_loader{ |value| value }
7
7
 
8
- moneta_specs STANDARD_SPECS
8
+ moneta_specs STANDARD_SPECS.with_each_key
9
9
  end
@@ -9,5 +9,5 @@ describe 'standard_pstore_with_expires', unsupported: defined?(JRUBY_VERSION), a
9
9
 
10
10
  moneta_loader{ |value| value }
11
11
 
12
- moneta_specs STANDARD_SPECS.with_expires
12
+ moneta_specs STANDARD_SPECS.with_expires.with_each_key
13
13
  end
@@ -3,5 +3,5 @@ describe 'standard_redis', adapter: :Redis do
3
3
  let(:min_ttl) { t_res }
4
4
 
5
5
  moneta_store :Redis, db: 4
6
- moneta_specs STANDARD_SPECS.with_native_expires
6
+ moneta_specs STANDARD_SPECS.with_native_expires.with_each_key
7
7
  end
@@ -3,5 +3,5 @@ describe 'standard_sdbm', unsupported: defined?(JRUBY_VERSION), adapter: :SDBM d
3
3
  {file: File.join(tempdir, "simple_sdbm")}
4
4
  end
5
5
 
6
- moneta_specs STANDARD_SPECS.without_multiprocess.without_large
6
+ moneta_specs STANDARD_SPECS.without_multiprocess.without_large.with_each_key
7
7
  end
@@ -7,5 +7,5 @@ describe 'standard_sdbm_with_expires', unsupported: defined?(JRUBY_VERSION), ada
7
7
  {file: File.join(tempdir, "simple_sdbm_with_expires"), expires: true}
8
8
  end
9
9
 
10
- moneta_specs STANDARD_SPECS.without_multiprocess.with_expires.without_large
10
+ moneta_specs STANDARD_SPECS.without_multiprocess.with_expires.without_large.with_each_key
11
11
  end
@@ -10,5 +10,5 @@ describe 'standard_sequel', adapter: :Sequel do
10
10
  }
11
11
  end
12
12
 
13
- moneta_specs STANDARD_SPECS
13
+ moneta_specs STANDARD_SPECS.with_each_key
14
14
  end
@@ -15,5 +15,5 @@ describe 'standard_sequel_with_expires', adapter: :Sequel do
15
15
  }
16
16
  end
17
17
 
18
- moneta_specs STANDARD_SPECS.with_expires
18
+ moneta_specs STANDARD_SPECS.with_expires.with_each_key
19
19
  end
@@ -3,5 +3,5 @@ describe 'standard_sqlite', unsupported: defined?(JRUBY_VERSION), adapter: :Sqli
3
3
  {file: File.join(tempdir, "standard_sqlite")}
4
4
  end
5
5
 
6
- moneta_specs STANDARD_SPECS.without_concurrent
6
+ moneta_specs STANDARD_SPECS.without_concurrent.with_each_key
7
7
  end
@@ -11,5 +11,5 @@ describe 'standard_sqlite_with_expires', unsupported: defined?(JRUBY_VERSION), a
11
11
  }
12
12
  end
13
13
 
14
- moneta_specs STANDARD_SPECS.with_expires.without_concurrent
14
+ moneta_specs STANDARD_SPECS.with_expires.without_concurrent.with_each_key
15
15
  end
@@ -3,5 +3,5 @@ describe 'standard_tdb', unsupported: defined?(JRUBY_VERSION), adapter: :TDB do
3
3
  {file: File.join(tempdir, "simple_tdb")}
4
4
  end
5
5
 
6
- moneta_specs STANDARD_SPECS.without_multiprocess
6
+ moneta_specs STANDARD_SPECS.without_multiprocess.with_each_key
7
7
  end