ccp 0.2.8 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/ccp.gemspec +11 -1
- data/lib/ccp.rb +1 -0
- data/lib/ccp/commands/resolvable.rb +1 -2
- data/lib/ccp/kvs.rb +46 -0
- data/lib/ccp/kvs/core.rb +28 -0
- data/lib/ccp/kvs/hash.rb +16 -0
- data/lib/ccp/kvs/tch.rb +12 -0
- data/lib/ccp/kvs/tokyo.rb +15 -0
- data/lib/ccp/kvs/tokyo/base.rb +49 -0
- data/lib/ccp/kvs/tokyo/cabinet.rb +56 -0
- data/lib/ccp/kvs/tokyo/info.rb +74 -0
- data/lib/ccp/kvs/tokyo/state_machine.rb +106 -0
- data/lib/ccp/serializers.rb +35 -16
- data/lib/ccp/serializers/core.rb +13 -10
- data/lib/ccp/serializers/json.rb +15 -11
- data/lib/ccp/serializers/msgpack.rb +12 -0
- data/lib/ccp/serializers/yaml.rb +8 -11
- data/lib/ccp/version.rb +1 -1
- data/spec/kvs/core_spec.rb +12 -0
- data/spec/kvs/kvs_spec.rb +44 -0
- data/spec/kvs/lookup_spec.rb +55 -0
- data/spec/kvs/tch_spec.rb +19 -0
- data/spec/kvs/tokyo/cabinet_spec.rb +208 -0
- data/spec/kvs/tokyo/info_spec.rb +27 -0
- data/spec/serializers/core_spec.rb +0 -1
- data/spec/serializers/lookup_spec.rb +86 -0
- data/spec/serializers/serializer_spec.rb +34 -0
- data/spec/spec_helper.rb +21 -1
- metadata +108 -18
- data/spec/serializers/json_spec.rb +0 -27
- data/spec/serializers/spec.rb +0 -39
- data/spec/serializers/yaml_spec.rb +0 -27
@@ -1,27 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
require 'spec_helper'
|
3
|
-
require 'fileutils'
|
4
|
-
|
5
|
-
describe Ccp::Serializers::Yaml do
|
6
|
-
its(:ext) { should == "yaml" }
|
7
|
-
|
8
|
-
describe "with Array(Integer)" do
|
9
|
-
it "should encode" do
|
10
|
-
subject.encode([1,2,3]).should == "--- \n- 1\n- 2\n- 3\n"
|
11
|
-
end
|
12
|
-
|
13
|
-
it "should decode" do
|
14
|
-
subject.decode("--- \n- 1\n- 2\n- 3\n").should == [1,2,3]
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
describe "with {String => Integer}" do
|
19
|
-
it "should encode" do
|
20
|
-
subject.encode("foo" => 1).should == "--- \nfoo: 1\n"
|
21
|
-
end
|
22
|
-
|
23
|
-
it "should decode" do
|
24
|
-
subject.decode("--- \nfoo: 1\n").should == {"foo" => 1}
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|