moneta 0.7.5 → 0.7.6
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +6 -0
- data/README.md +52 -51
- data/Rakefile +1 -3
- data/lib/moneta/adapters/daybreak.rb +7 -9
- data/lib/moneta/adapters/file.rb +2 -2
- data/lib/moneta/adapters/memcached/dalli.rb +1 -0
- data/lib/moneta/adapters/memcached/native.rb +1 -0
- data/lib/moneta/transformer.rb +4 -4
- data/lib/moneta/transformer/config.rb +2 -1
- data/lib/moneta/version.rb +1 -1
- data/script/benchmarks +52 -44
- data/script/generate-specs +238 -49
- data/spec/helper.rb +4 -0
- data/spec/moneta/adapter_activerecord_spec.rb +5 -0
- data/spec/moneta/adapter_cassandra_spec.rb +5 -0
- data/spec/moneta/adapter_cassandra_with_default_expires_spec.rb +5 -0
- data/spec/moneta/adapter_client_spec.rb +5 -0
- data/spec/moneta/adapter_cookie_spec.rb +4 -0
- data/spec/moneta/adapter_couch_spec.rb +5 -0
- data/spec/moneta/adapter_datamapper_spec.rb +5 -0
- data/spec/moneta/adapter_daybreak_spec.rb +4 -0
- data/spec/moneta/adapter_dbm_spec.rb +4 -0
- data/spec/moneta/adapter_file_spec.rb +5 -0
- data/spec/moneta/adapter_fog_spec.rb +5 -0
- data/spec/moneta/adapter_gdbm_spec.rb +5 -0
- data/spec/moneta/adapter_hbase_spec.rb +5 -0
- data/spec/moneta/adapter_leveldb_spec.rb +4 -0
- data/spec/moneta/adapter_localmemcache_spec.rb +5 -0
- data/spec/moneta/adapter_lruhash_spec.rb +4 -0
- data/spec/moneta/adapter_memcached_dalli_spec.rb +5 -0
- data/spec/moneta/adapter_memcached_dalli_with_default_expires_spec.rb +5 -0
- data/spec/moneta/adapter_memcached_native_spec.rb +5 -0
- data/spec/moneta/adapter_memcached_native_with_default_expires_spec.rb +5 -0
- data/spec/moneta/adapter_memcached_spec.rb +5 -0
- data/spec/moneta/adapter_memcached_with_default_expires_spec.rb +5 -0
- data/spec/moneta/adapter_memory_spec.rb +4 -0
- data/spec/moneta/adapter_mongo_spec.rb +5 -0
- data/spec/moneta/adapter_mongo_with_default_expires_spec.rb +5 -0
- data/spec/moneta/adapter_pstore_spec.rb +5 -0
- data/spec/moneta/adapter_redis_spec.rb +5 -0
- data/spec/moneta/adapter_redis_with_default_expires_spec.rb +5 -0
- data/spec/moneta/adapter_restclient_spec.rb +5 -0
- data/spec/moneta/adapter_riak_spec.rb +5 -0
- data/spec/moneta/adapter_sdbm_spec.rb +4 -0
- data/spec/moneta/adapter_sequel_spec.rb +5 -0
- data/spec/moneta/adapter_sqlite_spec.rb +5 -0
- data/spec/moneta/adapter_tdb_spec.rb +4 -0
- data/spec/moneta/adapter_tokyocabinet_bdb_spec.rb +4 -0
- data/spec/moneta/adapter_tokyocabinet_hdb_spec.rb +4 -0
- data/spec/moneta/adapter_yaml_spec.rb +5 -0
- data/spec/moneta/cache_file_memory_spec.rb +5 -0
- data/spec/moneta/cache_memory_null_spec.rb +4 -0
- data/spec/moneta/expires_file_spec.rb +5 -0
- data/spec/moneta/expires_memory_spec.rb +4 -0
- data/spec/moneta/expires_memory_with_default_expires_spec.rb +4 -0
- data/spec/moneta/lock_spec.rb +4 -0
- data/spec/moneta/null_adapter_spec.rb +4 -0
- data/spec/moneta/optionmerger_spec.rb +5 -1
- data/spec/moneta/pool_spec.rb +5 -0
- data/spec/moneta/proxy_expires_memory_spec.rb +4 -0
- data/spec/moneta/proxy_redis_spec.rb +5 -0
- data/spec/moneta/shared_spec.rb +5 -0
- data/spec/moneta/simple_activerecord_spec.rb +6 -1
- data/spec/moneta/simple_activerecord_with_expires_spec.rb +6 -1
- data/spec/moneta/simple_cassandra_spec.rb +6 -1
- data/spec/moneta/simple_client_tcp_spec.rb +6 -1
- data/spec/moneta/simple_client_unix_spec.rb +6 -1
- data/spec/moneta/simple_couch_spec.rb +6 -1
- data/spec/moneta/simple_couch_with_expires_spec.rb +6 -1
- data/spec/moneta/simple_datamapper_spec.rb +6 -1
- data/spec/moneta/simple_datamapper_with_expires_spec.rb +6 -1
- data/spec/moneta/simple_datamapper_with_repository_spec.rb +6 -1
- data/spec/moneta/simple_daybreak_spec.rb +5 -1
- data/spec/moneta/simple_daybreak_with_expires_spec.rb +5 -1
- data/spec/moneta/simple_dbm_spec.rb +5 -1
- data/spec/moneta/simple_dbm_with_expires_spec.rb +5 -1
- data/spec/moneta/simple_file_spec.rb +6 -1
- data/spec/moneta/simple_file_with_expires_spec.rb +6 -1
- data/spec/moneta/simple_fog_spec.rb +6 -1
- data/spec/moneta/simple_fog_with_expires_spec.rb +6 -1
- data/spec/moneta/simple_gdbm_spec.rb +5 -1
- data/spec/moneta/simple_gdbm_with_expires_spec.rb +5 -1
- data/spec/moneta/simple_hashfile_spec.rb +6 -1
- data/spec/moneta/simple_hashfile_with_expires_spec.rb +6 -1
- data/spec/moneta/simple_hbase_spec.rb +6 -1
- data/spec/moneta/simple_hbase_with_expires_spec.rb +6 -1
- data/spec/moneta/simple_leveldb_spec.rb +5 -1
- data/spec/moneta/simple_leveldb_with_expires_spec.rb +5 -1
- data/spec/moneta/simple_localmemcache_spec.rb +6 -1
- data/spec/moneta/simple_localmemcache_with_expires_spec.rb +6 -1
- data/spec/moneta/simple_lruhash_spec.rb +5 -1
- data/spec/moneta/simple_lruhash_with_expires_spec.rb +5 -1
- data/spec/moneta/simple_memcached_dalli_spec.rb +6 -1
- data/spec/moneta/simple_memcached_native_spec.rb +6 -1
- data/spec/moneta/simple_memcached_spec.rb +6 -1
- data/spec/moneta/simple_memory_spec.rb +5 -1
- data/spec/moneta/simple_memory_with_compress_spec.rb +5 -1
- data/spec/moneta/simple_memory_with_expires_spec.rb +5 -1
- data/spec/moneta/simple_memory_with_json_key_serializer_spec.rb +5 -1
- data/spec/moneta/simple_memory_with_json_serializer_spec.rb +5 -1
- data/spec/moneta/simple_memory_with_json_value_serializer_spec.rb +5 -1
- data/spec/moneta/simple_memory_with_prefix_spec.rb +5 -1
- data/spec/moneta/simple_memory_with_snappy_compress_spec.rb +5 -1
- data/spec/moneta/simple_mongo_spec.rb +6 -1
- data/spec/moneta/simple_null_spec.rb +5 -1
- data/spec/moneta/simple_pstore_spec.rb +6 -1
- data/spec/moneta/simple_pstore_with_expires_spec.rb +6 -1
- data/spec/moneta/simple_redis_spec.rb +6 -1
- data/spec/moneta/simple_restclient_spec.rb +6 -1
- data/spec/moneta/simple_riak_spec.rb +6 -1
- data/spec/moneta/simple_riak_with_expires_spec.rb +6 -1
- data/spec/moneta/simple_sdbm_spec.rb +5 -1
- data/spec/moneta/simple_sdbm_with_expires_spec.rb +5 -1
- data/spec/moneta/simple_sequel_spec.rb +6 -1
- data/spec/moneta/simple_sequel_with_expires_spec.rb +6 -1
- data/spec/moneta/simple_sqlite_spec.rb +6 -1
- data/spec/moneta/simple_sqlite_with_expires_spec.rb +6 -1
- data/spec/moneta/simple_tdb_spec.rb +5 -1
- data/spec/moneta/simple_tdb_with_expires_spec.rb +5 -1
- data/spec/moneta/simple_tokyocabinet_spec.rb +5 -1
- data/spec/moneta/simple_tokyocabinet_with_expires_spec.rb +5 -1
- data/spec/moneta/simple_yaml_spec.rb +6 -1
- data/spec/moneta/simple_yaml_with_expires_spec.rb +6 -1
- data/spec/moneta/stack_file_memory_spec.rb +5 -0
- data/spec/moneta/stack_memory_file_spec.rb +5 -0
- data/spec/moneta/transformer_bencode_spec.rb +8 -0
- data/spec/moneta/transformer_bert_spec.rb +8 -0
- data/spec/moneta/transformer_bson_spec.rb +8 -0
- data/spec/moneta/transformer_bzip2_spec.rb +8 -0
- data/spec/moneta/transformer_json_spec.rb +8 -0
- data/spec/moneta/transformer_key_marshal_spec.rb +8 -0
- data/spec/moneta/transformer_key_to_s_spec.rb +72 -0
- data/spec/moneta/transformer_key_yaml_spec.rb +8 -0
- data/spec/moneta/transformer_lzma_spec.rb +8 -0
- data/spec/moneta/transformer_lzo_spec.rb +8 -0
- data/spec/moneta/transformer_marshal_base64_spec.rb +8 -0
- data/spec/moneta/transformer_marshal_escape_spec.rb +8 -0
- data/spec/moneta/transformer_marshal_hmac_spec.rb +8 -0
- data/spec/moneta/transformer_marshal_md5_spec.rb +8 -0
- data/spec/moneta/transformer_marshal_md5_spread_spec.rb +8 -0
- data/spec/moneta/transformer_marshal_prefix_spec.rb +8 -0
- data/spec/moneta/transformer_marshal_rmd160_spec.rb +8 -0
- data/spec/moneta/transformer_marshal_sha1_spec.rb +8 -0
- data/spec/moneta/transformer_marshal_sha256_spec.rb +8 -0
- data/spec/moneta/transformer_marshal_sha384_spec.rb +8 -0
- data/spec/moneta/transformer_marshal_sha512_spec.rb +8 -0
- data/spec/moneta/transformer_marshal_spec.rb +8 -0
- data/spec/moneta/transformer_marshal_truncate_spec.rb +8 -0
- data/spec/moneta/transformer_marshal_uuencode_spec.rb +8 -0
- data/spec/moneta/transformer_msgpack_spec.rb +8 -0
- data/spec/moneta/transformer_ox_spec.rb +8 -0
- data/spec/moneta/transformer_quicklz_spec.rb +8 -0
- data/spec/moneta/transformer_snappy_spec.rb +8 -0
- data/spec/moneta/transformer_tnet_spec.rb +8 -0
- data/spec/moneta/transformer_value_marshal_spec.rb +8 -0
- data/spec/moneta/transformer_value_yaml_spec.rb +8 -0
- data/spec/moneta/transformer_yaml_spec.rb +8 -0
- data/spec/moneta/transformer_zlib_spec.rb +8 -0
- data/spec/monetaspecs.rb +11 -0
- metadata +4 -2
@@ -2,8 +2,12 @@
|
|
2
2
|
require 'helper'
|
3
3
|
|
4
4
|
describe_moneta "simple_sdbm" do
|
5
|
+
def log
|
6
|
+
@log ||= File.open(File.join(make_tempdir, 'simple_sdbm.log'), 'a')
|
7
|
+
end
|
8
|
+
|
5
9
|
def new_store
|
6
|
-
Moneta.new(:SDBM, :file => File.join(make_tempdir, "simple_sdbm"), :logger => {:out =>
|
10
|
+
Moneta.new(:SDBM, :file => File.join(make_tempdir, "simple_sdbm"), :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_sdbm_with_expires" do
|
5
|
+
def log
|
6
|
+
@log ||= File.open(File.join(make_tempdir, 'simple_sdbm_with_expires.log'), 'a')
|
7
|
+
end
|
8
|
+
|
5
9
|
def new_store
|
6
|
-
Moneta.new(:SDBM, :file => File.join(make_tempdir, "simple_sdbm_with_expires"), :expires => true, :logger => {:out =>
|
10
|
+
Moneta.new(:SDBM, :file => File.join(make_tempdir, "simple_sdbm_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_sequel" do
|
5
|
+
def log
|
6
|
+
@log ||= File.open(File.join(make_tempdir, 'simple_sequel.log'), 'a')
|
7
|
+
end
|
8
|
+
|
5
9
|
def new_store
|
6
|
-
Moneta.new(:Sequel, :db => (defined?(JRUBY_VERSION) ? "jdbc:sqlite:" : "sqlite:") + File.join(make_tempdir, "simple_sequel"), :logger => {:out =>
|
10
|
+
Moneta.new(:Sequel, :db => (defined?(JRUBY_VERSION) ? "jdbc:sqlite:" : "sqlite:") + File.join(make_tempdir, "simple_sequel"), :logger => {:out => log})
|
7
11
|
end
|
8
12
|
|
9
13
|
def load_value(value)
|
@@ -14,6 +18,7 @@ describe_moneta "simple_sequel" 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_sequel_with_expires" do
|
5
|
+
def log
|
6
|
+
@log ||= File.open(File.join(make_tempdir, 'simple_sequel_with_expires.log'), 'a')
|
7
|
+
end
|
8
|
+
|
5
9
|
def new_store
|
6
|
-
Moneta.new(:Sequel, :db => (defined?(JRUBY_VERSION) ? "jdbc:sqlite:" : "sqlite:") + File.join(make_tempdir, "simple_sequel_with_expires"), :expires => true, :logger => {:out =>
|
10
|
+
Moneta.new(:Sequel, :db => (defined?(JRUBY_VERSION) ? "jdbc:sqlite:" : "sqlite:") + File.join(make_tempdir, "simple_sequel_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_sequel_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_sqlite" do
|
5
|
+
def log
|
6
|
+
@log ||= File.open(File.join(make_tempdir, 'simple_sqlite.log'), 'a')
|
7
|
+
end
|
8
|
+
|
5
9
|
def new_store
|
6
|
-
Moneta.new(:Sqlite, :file => File.join(make_tempdir, "simple_sqlite"), :logger => {:out =>
|
10
|
+
Moneta.new(:Sqlite, :file => File.join(make_tempdir, "simple_sqlite"), :logger => {:out => log})
|
7
11
|
end
|
8
12
|
|
9
13
|
def load_value(value)
|
@@ -14,6 +18,7 @@ describe_moneta "simple_sqlite" 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_sqlite_with_expires" do
|
5
|
+
def log
|
6
|
+
@log ||= File.open(File.join(make_tempdir, 'simple_sqlite_with_expires.log'), 'a')
|
7
|
+
end
|
8
|
+
|
5
9
|
def new_store
|
6
|
-
Moneta.new(:Sqlite, :file => File.join(make_tempdir, "simple_sqlite_with_expires"), :expires => true, :logger => {:out =>
|
10
|
+
Moneta.new(:Sqlite, :file => File.join(make_tempdir, "simple_sqlite_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_sqlite_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_tdb" do
|
5
|
+
def log
|
6
|
+
@log ||= File.open(File.join(make_tempdir, 'simple_tdb.log'), 'a')
|
7
|
+
end
|
8
|
+
|
5
9
|
def new_store
|
6
|
-
Moneta.new(:TDB, :file => File.join(make_tempdir, "simple_tdb"), :logger => {:out =>
|
10
|
+
Moneta.new(:TDB, :file => File.join(make_tempdir, "simple_tdb"), :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_tdb_with_expires" do
|
5
|
+
def log
|
6
|
+
@log ||= File.open(File.join(make_tempdir, 'simple_tdb_with_expires.log'), 'a')
|
7
|
+
end
|
8
|
+
|
5
9
|
def new_store
|
6
|
-
Moneta.new(:TDB, :file => File.join(make_tempdir, "simple_tdb_with_expires"), :expires => true, :logger => {:out =>
|
10
|
+
Moneta.new(:TDB, :file => File.join(make_tempdir, "simple_tdb_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_tokyocabinet" do
|
5
|
+
def log
|
6
|
+
@log ||= File.open(File.join(make_tempdir, 'simple_tokyocabinet.log'), 'a')
|
7
|
+
end
|
8
|
+
|
5
9
|
def new_store
|
6
|
-
Moneta.new(:TokyoCabinet, :file => File.join(make_tempdir, "simple_tokyocabinet"), :logger => {:out =>
|
10
|
+
Moneta.new(:TokyoCabinet, :file => File.join(make_tempdir, "simple_tokyocabinet"), :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_tokyocabinet_with_expires" do
|
5
|
+
def log
|
6
|
+
@log ||= File.open(File.join(make_tempdir, 'simple_tokyocabinet_with_expires.log'), 'a')
|
7
|
+
end
|
8
|
+
|
5
9
|
def new_store
|
6
|
-
Moneta.new(:TokyoCabinet, :file => File.join(make_tempdir, "simple_tokyocabinet_with_expires"), :expires => true, :logger => {:out =>
|
10
|
+
Moneta.new(:TokyoCabinet, :file => File.join(make_tempdir, "simple_tokyocabinet_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_yaml" do
|
5
|
+
def log
|
6
|
+
@log ||= File.open(File.join(make_tempdir, 'simple_yaml.log'), 'a')
|
7
|
+
end
|
8
|
+
|
5
9
|
def new_store
|
6
|
-
Moneta.new(:YAML, :file => File.join(make_tempdir, "simple_yaml"), :logger => {:out =>
|
10
|
+
Moneta.new(:YAML, :file => File.join(make_tempdir, "simple_yaml"), :logger => {:out => log})
|
7
11
|
end
|
8
12
|
|
9
13
|
def load_value(value)
|
@@ -13,6 +17,7 @@ describe_moneta "simple_yaml" do
|
|
13
17
|
include_context 'setup_store'
|
14
18
|
it_should_behave_like 'increment'
|
15
19
|
it_should_behave_like 'marshallable_key'
|
20
|
+
it_should_behave_like 'multiprocess'
|
16
21
|
it_should_behave_like 'null_objectkey_objectvalue'
|
17
22
|
it_should_behave_like 'null_objectkey_stringvalue'
|
18
23
|
it_should_behave_like 'null_objectkey_hashvalue'
|
@@ -2,8 +2,12 @@
|
|
2
2
|
require 'helper'
|
3
3
|
|
4
4
|
describe_moneta "simple_yaml_with_expires" do
|
5
|
+
def log
|
6
|
+
@log ||= File.open(File.join(make_tempdir, 'simple_yaml_with_expires.log'), 'a')
|
7
|
+
end
|
8
|
+
|
5
9
|
def new_store
|
6
|
-
Moneta.new(:YAML, :file => File.join(make_tempdir, "simple_yaml_with_expires"), :expires => true, :logger => {:out =>
|
10
|
+
Moneta.new(:YAML, :file => File.join(make_tempdir, "simple_yaml_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_yaml_with_expires" do
|
|
14
18
|
it_should_behave_like 'expires'
|
15
19
|
it_should_behave_like 'increment'
|
16
20
|
it_should_behave_like 'marshallable_key'
|
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,6 +2,10 @@
|
|
2
2
|
require 'helper'
|
3
3
|
|
4
4
|
describe_moneta "stack_file_memory" do
|
5
|
+
def log
|
6
|
+
@log ||= File.open(File.join(make_tempdir, 'stack_file_memory.log'), 'a')
|
7
|
+
end
|
8
|
+
|
5
9
|
def new_store
|
6
10
|
Moneta.build do
|
7
11
|
use(:Stack) do
|
@@ -18,6 +22,7 @@ describe_moneta "stack_file_memory" do
|
|
18
22
|
end
|
19
23
|
|
20
24
|
include_context 'setup_store'
|
25
|
+
it_should_behave_like 'multiprocess'
|
21
26
|
it_should_behave_like 'not_increment'
|
22
27
|
it_should_behave_like 'null_stringkey_stringvalue'
|
23
28
|
it_should_behave_like 'persist_stringkey_stringvalue'
|
@@ -2,6 +2,10 @@
|
|
2
2
|
require 'helper'
|
3
3
|
|
4
4
|
describe_moneta "stack_memory_file" do
|
5
|
+
def log
|
6
|
+
@log ||= File.open(File.join(make_tempdir, 'stack_memory_file.log'), 'a')
|
7
|
+
end
|
8
|
+
|
5
9
|
def new_store
|
6
10
|
Moneta.build do
|
7
11
|
use(:Stack) do
|
@@ -18,6 +22,7 @@ describe_moneta "stack_memory_file" do
|
|
18
22
|
end
|
19
23
|
|
20
24
|
include_context 'setup_store'
|
25
|
+
it_should_behave_like 'multiprocess'
|
21
26
|
it_should_behave_like 'not_increment'
|
22
27
|
it_should_behave_like 'null_stringkey_stringvalue'
|
23
28
|
it_should_behave_like 'persist_stringkey_stringvalue'
|
@@ -2,6 +2,10 @@
|
|
2
2
|
require 'helper'
|
3
3
|
|
4
4
|
describe_moneta "transformer_bencode" do
|
5
|
+
def log
|
6
|
+
@log ||= File.open(File.join(make_tempdir, 'transformer_bencode.log'), 'a')
|
7
|
+
end
|
8
|
+
|
5
9
|
def new_store
|
6
10
|
Moneta.build do
|
7
11
|
use :Transformer, :key => :bencode, :value => :bencode
|
@@ -40,4 +44,8 @@ describe_moneta "transformer_bencode" do
|
|
40
44
|
it_should_behave_like 'store_integerkey_hashvalue'
|
41
45
|
it_should_behave_like 'store_integerkey_integervalue'
|
42
46
|
it_should_behave_like 'transform_value'
|
47
|
+
it 'compile transformer class' do
|
48
|
+
store.should_not be_nil
|
49
|
+
Moneta::Transformer::BencodeKeyBencodeValue.should_not be_nil
|
50
|
+
end
|
43
51
|
end
|
@@ -2,6 +2,10 @@
|
|
2
2
|
require 'helper'
|
3
3
|
|
4
4
|
describe_moneta "transformer_bert" do
|
5
|
+
def log
|
6
|
+
@log ||= File.open(File.join(make_tempdir, 'transformer_bert.log'), 'a')
|
7
|
+
end
|
8
|
+
|
5
9
|
def new_store
|
6
10
|
Moneta.build do
|
7
11
|
use :Transformer, :key => :bert, :value => :bert
|
@@ -40,4 +44,8 @@ describe_moneta "transformer_bert" do
|
|
40
44
|
it_should_behave_like 'store_integerkey_hashvalue'
|
41
45
|
it_should_behave_like 'store_integerkey_integervalue'
|
42
46
|
it_should_behave_like 'transform_value'
|
47
|
+
it 'compile transformer class' do
|
48
|
+
store.should_not be_nil
|
49
|
+
Moneta::Transformer::BertKeyBertValue.should_not be_nil
|
50
|
+
end
|
43
51
|
end
|
@@ -2,6 +2,10 @@
|
|
2
2
|
require 'helper'
|
3
3
|
|
4
4
|
describe_moneta "transformer_bson" do
|
5
|
+
def log
|
6
|
+
@log ||= File.open(File.join(make_tempdir, 'transformer_bson.log'), 'a')
|
7
|
+
end
|
8
|
+
|
5
9
|
def new_store
|
6
10
|
Moneta.build do
|
7
11
|
use :Transformer, :key => :bson, :value => :bson
|
@@ -40,4 +44,8 @@ describe_moneta "transformer_bson" do
|
|
40
44
|
it_should_behave_like 'store_integerkey_hashvalue'
|
41
45
|
it_should_behave_like 'store_integerkey_integervalue'
|
42
46
|
it_should_behave_like 'transform_value'
|
47
|
+
it 'compile transformer class' do
|
48
|
+
store.should_not be_nil
|
49
|
+
Moneta::Transformer::BsonKeyBsonValue.should_not be_nil
|
50
|
+
end
|
43
51
|
end
|
@@ -2,6 +2,10 @@
|
|
2
2
|
require 'helper'
|
3
3
|
|
4
4
|
describe_moneta "transformer_bzip2" do
|
5
|
+
def log
|
6
|
+
@log ||= File.open(File.join(make_tempdir, 'transformer_bzip2.log'), 'a')
|
7
|
+
end
|
8
|
+
|
5
9
|
def new_store
|
6
10
|
Moneta.build do
|
7
11
|
use :Transformer, :value => :bzip2
|
@@ -34,4 +38,8 @@ describe_moneta "transformer_bzip2" do
|
|
34
38
|
it_should_behave_like 'store_nilkey_stringvalue'
|
35
39
|
it_should_behave_like 'store_integerkey_stringvalue'
|
36
40
|
it_should_behave_like 'transform_value'
|
41
|
+
it 'compile transformer class' do
|
42
|
+
store.should_not be_nil
|
43
|
+
Moneta::Transformer::Bzip2Value.should_not be_nil
|
44
|
+
end
|
37
45
|
end
|
@@ -2,6 +2,10 @@
|
|
2
2
|
require 'helper'
|
3
3
|
|
4
4
|
describe_moneta "transformer_json" do
|
5
|
+
def log
|
6
|
+
@log ||= File.open(File.join(make_tempdir, 'transformer_json.log'), 'a')
|
7
|
+
end
|
8
|
+
|
5
9
|
def new_store
|
6
10
|
Moneta.build do
|
7
11
|
use :Transformer, :key => :json, :value => :json
|
@@ -40,4 +44,8 @@ describe_moneta "transformer_json" do
|
|
40
44
|
it_should_behave_like 'store_integerkey_hashvalue'
|
41
45
|
it_should_behave_like 'store_integerkey_integervalue'
|
42
46
|
it_should_behave_like 'transform_value'
|
47
|
+
it 'compile transformer class' do
|
48
|
+
store.should_not be_nil
|
49
|
+
Moneta::Transformer::JsonKeyJsonValue.should_not be_nil
|
50
|
+
end
|
43
51
|
end
|
@@ -2,6 +2,10 @@
|
|
2
2
|
require 'helper'
|
3
3
|
|
4
4
|
describe_moneta "transformer_key_marshal" do
|
5
|
+
def log
|
6
|
+
@log ||= File.open(File.join(make_tempdir, 'transformer_key_marshal.log'), 'a')
|
7
|
+
end
|
8
|
+
|
5
9
|
def new_store
|
6
10
|
Moneta.build do
|
7
11
|
use :Transformer, :key => :marshal
|
@@ -106,4 +110,8 @@ describe_moneta "transformer_key_marshal" do
|
|
106
110
|
it_should_behave_like 'store_integerkey_nilvalue'
|
107
111
|
it_should_behave_like 'store_integerkey_integervalue'
|
108
112
|
it_should_behave_like 'transform_value'
|
113
|
+
it 'compile transformer class' do
|
114
|
+
store.should_not be_nil
|
115
|
+
Moneta::Transformer::MarshalKey.should_not be_nil
|
116
|
+
end
|
109
117
|
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# Generated by generate-specs
|
2
|
+
require 'helper'
|
3
|
+
|
4
|
+
describe_moneta "transformer_key_to_s" do
|
5
|
+
def log
|
6
|
+
@log ||= File.open(File.join(make_tempdir, 'transformer_key_to_s.log'), 'a')
|
7
|
+
end
|
8
|
+
|
9
|
+
def new_store
|
10
|
+
Moneta.build do
|
11
|
+
use :Transformer, :key => :to_s
|
12
|
+
adapter :Memory
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def load_value(value)
|
17
|
+
value
|
18
|
+
end
|
19
|
+
|
20
|
+
include_context 'setup_store'
|
21
|
+
it_should_behave_like 'increment'
|
22
|
+
it_should_behave_like 'null_stringkey_objectvalue'
|
23
|
+
it_should_behave_like 'null_stringkey_stringvalue'
|
24
|
+
it_should_behave_like 'null_stringkey_hashvalue'
|
25
|
+
it_should_behave_like 'null_stringkey_booleanvalue'
|
26
|
+
it_should_behave_like 'null_stringkey_nilvalue'
|
27
|
+
it_should_behave_like 'null_stringkey_integervalue'
|
28
|
+
it_should_behave_like 'null_hashkey_objectvalue'
|
29
|
+
it_should_behave_like 'null_hashkey_stringvalue'
|
30
|
+
it_should_behave_like 'null_hashkey_hashvalue'
|
31
|
+
it_should_behave_like 'null_hashkey_booleanvalue'
|
32
|
+
it_should_behave_like 'null_hashkey_nilvalue'
|
33
|
+
it_should_behave_like 'null_hashkey_integervalue'
|
34
|
+
it_should_behave_like 'null_integerkey_objectvalue'
|
35
|
+
it_should_behave_like 'null_integerkey_stringvalue'
|
36
|
+
it_should_behave_like 'null_integerkey_hashvalue'
|
37
|
+
it_should_behave_like 'null_integerkey_booleanvalue'
|
38
|
+
it_should_behave_like 'null_integerkey_nilvalue'
|
39
|
+
it_should_behave_like 'null_integerkey_integervalue'
|
40
|
+
it_should_behave_like 'returnsame_stringkey_objectvalue'
|
41
|
+
it_should_behave_like 'returnsame_stringkey_stringvalue'
|
42
|
+
it_should_behave_like 'returnsame_stringkey_hashvalue'
|
43
|
+
it_should_behave_like 'returnsame_hashkey_objectvalue'
|
44
|
+
it_should_behave_like 'returnsame_hashkey_stringvalue'
|
45
|
+
it_should_behave_like 'returnsame_hashkey_hashvalue'
|
46
|
+
it_should_behave_like 'returnsame_integerkey_objectvalue'
|
47
|
+
it_should_behave_like 'returnsame_integerkey_stringvalue'
|
48
|
+
it_should_behave_like 'returnsame_integerkey_hashvalue'
|
49
|
+
it_should_behave_like 'store_stringkey_objectvalue'
|
50
|
+
it_should_behave_like 'store_stringkey_stringvalue'
|
51
|
+
it_should_behave_like 'store_stringkey_hashvalue'
|
52
|
+
it_should_behave_like 'store_stringkey_booleanvalue'
|
53
|
+
it_should_behave_like 'store_stringkey_nilvalue'
|
54
|
+
it_should_behave_like 'store_stringkey_integervalue'
|
55
|
+
it_should_behave_like 'store_hashkey_objectvalue'
|
56
|
+
it_should_behave_like 'store_hashkey_stringvalue'
|
57
|
+
it_should_behave_like 'store_hashkey_hashvalue'
|
58
|
+
it_should_behave_like 'store_hashkey_booleanvalue'
|
59
|
+
it_should_behave_like 'store_hashkey_nilvalue'
|
60
|
+
it_should_behave_like 'store_hashkey_integervalue'
|
61
|
+
it_should_behave_like 'store_integerkey_objectvalue'
|
62
|
+
it_should_behave_like 'store_integerkey_stringvalue'
|
63
|
+
it_should_behave_like 'store_integerkey_hashvalue'
|
64
|
+
it_should_behave_like 'store_integerkey_booleanvalue'
|
65
|
+
it_should_behave_like 'store_integerkey_nilvalue'
|
66
|
+
it_should_behave_like 'store_integerkey_integervalue'
|
67
|
+
it_should_behave_like 'transform_value'
|
68
|
+
it 'compile transformer class' do
|
69
|
+
store.should_not be_nil
|
70
|
+
Moneta::Transformer::To_sKey.should_not be_nil
|
71
|
+
end
|
72
|
+
end
|