awesome-cheeba 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/cheeba.gemspec +1 -1
- data/lib/cheeba/reader/builder.rb +1 -0
- data/lib/cheeba/version.rb +1 -1
- data/test/test_cheeba.rb +47 -0
- metadata +1 -1
data/cheeba.gemspec
CHANGED
data/lib/cheeba/version.rb
CHANGED
data/test/test_cheeba.rb
CHANGED
@@ -52,6 +52,19 @@ class TestCheeba < MiniTest::Unit::TestCase
|
|
52
52
|
" 3:",
|
53
53
|
" count: 2",
|
54
54
|
" model: White Wonder Bread"]
|
55
|
+
@nested =<<FEKJA
|
56
|
+
domain: test
|
57
|
+
manifest:
|
58
|
+
manifest_id:
|
59
|
+
format: String
|
60
|
+
master_id:
|
61
|
+
format: String
|
62
|
+
owner_id:
|
63
|
+
format: String
|
64
|
+
log_id:
|
65
|
+
desc: log of all transactions withing the entire tree
|
66
|
+
format: String
|
67
|
+
FEKJA
|
55
68
|
end
|
56
69
|
|
57
70
|
def test_read_hash
|
@@ -66,6 +79,40 @@ class TestCheeba < MiniTest::Unit::TestCase
|
|
66
79
|
assert_equal exp, act
|
67
80
|
end
|
68
81
|
|
82
|
+
def test_read_nested_hash_options_symbolize
|
83
|
+
exp = {
|
84
|
+
:domain => :test,
|
85
|
+
:manifest => {
|
86
|
+
:manifest_id => {
|
87
|
+
:format => :String},
|
88
|
+
:master_id => {
|
89
|
+
:format => :String},
|
90
|
+
:owner_id=>{
|
91
|
+
:format => :String},
|
92
|
+
:log_id => {
|
93
|
+
:desc => :"log of all transactions withing the entire tree",
|
94
|
+
:format => :String}}}
|
95
|
+
act = Cheeba.read(@nested, {:symbolize => true})
|
96
|
+
assert_equal exp, act
|
97
|
+
end
|
98
|
+
|
99
|
+
def test_read_nested_hash_options_symbolize_keys
|
100
|
+
exp = {
|
101
|
+
:domain=>"test",
|
102
|
+
:manifest=>{
|
103
|
+
:manifest_id=>{
|
104
|
+
:format => "String"},
|
105
|
+
:master_id=>{
|
106
|
+
:format => "String"},
|
107
|
+
:owner_id=>{
|
108
|
+
:format => "String"},
|
109
|
+
:log_id=>{
|
110
|
+
:desc=>"log of all transactions withing the entire tree",
|
111
|
+
:format => "String"}}}
|
112
|
+
act = Cheeba.read(@nested, {:symbolize_keys => true})
|
113
|
+
assert_equal exp, act
|
114
|
+
end
|
115
|
+
|
69
116
|
def test_read_string
|
70
117
|
str = IO.read("#{@files}/hashes.cash")
|
71
118
|
act = Cheeba.read(str)
|