looksist 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/looksist/core.rb +3 -3
- data/lib/looksist/redis_service.rb +3 -3
- data/lib/looksist/version.rb +1 -1
- data/spec/looksist/hashed_spec.rb +287 -247
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d37e2dc990cb95ab09f7a065a226c2265808e1d7
|
4
|
+
data.tar.gz: 6e6886eca193e7b311b5c94ead38e098257d1821
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82919b4456e2340f65119e66f7411051c9b5cccad412e2a150e2f03982542e1214ad4ad7f6c412567e7d447dfb722041c211bbaa6d25e8298ee899e195b285eb
|
7
|
+
data.tar.gz: 06003bbbc83e7499be00083848a16f97fc0d8db1e25c7376c16b0209807a172e712b444181e5c9cb0f8f9d24fcc968057df9fd64051f28448d5cfb728f82c2b8
|
data/lib/looksist/core.rb
CHANGED
@@ -42,7 +42,7 @@ module Looksist
|
|
42
42
|
|
43
43
|
|
44
44
|
def as_json(opts)
|
45
|
-
Looksist.driver.json_opts(self, opts)
|
45
|
+
Looksist.driver.json_opts(self, self.class.lookup_attributes, opts)
|
46
46
|
end
|
47
47
|
|
48
48
|
end
|
@@ -50,8 +50,8 @@ module Looksist
|
|
50
50
|
module Serializers
|
51
51
|
class Her
|
52
52
|
class << self
|
53
|
-
def json_opts(obj, _)
|
54
|
-
lookup_attributes
|
53
|
+
def json_opts(obj, lookup_attributes, _)
|
54
|
+
lookup_attributes ||= {}
|
55
55
|
other_attributes = lookup_attributes.keys.each_with_object({}) do |a, acc|
|
56
56
|
using = lookup_attributes[a]
|
57
57
|
acc[a] = obj.send(a) if obj.respond_to?(using)
|
@@ -36,10 +36,10 @@ module Looksist
|
|
36
36
|
keys = ids.collect { |id| redis_key(entity, id) }
|
37
37
|
missed_keys = cache_op(proc_from { keys.uniq }) { (keys - @cache.keys).uniq }
|
38
38
|
unless missed_keys.empty?
|
39
|
-
|
40
|
-
cache_op { @cache.merge!(
|
39
|
+
response = Hash[*missed_keys.zip(@client.mget *missed_keys).flatten]
|
40
|
+
cache_op { @cache.merge!(response) }
|
41
41
|
end
|
42
|
-
(cache_op(proc_from {
|
42
|
+
(cache_op(proc_from { keys.collect {|k| response[k] } }) { @cache.mslice(keys) })
|
43
43
|
end
|
44
44
|
|
45
45
|
def cache_op(computed = nil)
|
data/lib/looksist/version.rb
CHANGED
@@ -1,334 +1,374 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Looksist::Hashed do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
context('with_l2_cache') do
|
5
|
+
before(:each) do
|
6
|
+
@mock = {}
|
7
|
+
Looksist.configure do |looksist|
|
8
|
+
looksist.lookup_store = @mock
|
9
|
+
looksist.cache_buffer_size = 10
|
10
|
+
end
|
9
11
|
end
|
10
|
-
end
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
context 'inject ' do
|
14
|
+
it 'should be capable to deep lookup and inject' do
|
15
|
+
class Menu
|
16
|
+
include Looksist
|
17
|
+
|
18
|
+
def metrics
|
19
|
+
{
|
20
|
+
table: {
|
21
|
+
menu: [
|
22
|
+
{
|
23
|
+
item_id: 1
|
24
|
+
},
|
25
|
+
{
|
26
|
+
item_id: 2
|
27
|
+
}
|
28
|
+
]
|
29
|
+
}
|
30
|
+
}
|
31
|
+
end
|
16
32
|
|
17
|
-
|
18
|
-
{
|
19
|
-
table: {
|
20
|
-
menu: [
|
21
|
-
{
|
22
|
-
item_id: 1
|
23
|
-
},
|
24
|
-
{
|
25
|
-
item_id: 2
|
26
|
-
}
|
27
|
-
]
|
28
|
-
}
|
29
|
-
}
|
33
|
+
inject after: :metrics, at: '$.table.menu', using: :item_id, populate: :item_name
|
30
34
|
end
|
31
35
|
|
32
|
-
|
36
|
+
expect(@mock).to receive(:mget).once.with(*%w(items/1 items/2)).and_return(%w(Idly Pongal))
|
37
|
+
|
38
|
+
expect(Menu.new.metrics).to eq({
|
39
|
+
table: {
|
40
|
+
menu: [{
|
41
|
+
item_id: 1,
|
42
|
+
item_name: 'Idly'
|
43
|
+
},
|
44
|
+
{
|
45
|
+
item_id: 2,
|
46
|
+
item_name: 'Pongal'
|
47
|
+
}]
|
48
|
+
}
|
49
|
+
})
|
33
50
|
end
|
34
51
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
52
|
+
it 'should be capable to deep lookup and inject from custom bucket' do
|
53
|
+
class CustomizedMenu
|
54
|
+
include Looksist
|
55
|
+
|
56
|
+
def metrics
|
57
|
+
{
|
58
|
+
table: {
|
59
|
+
menu: [
|
60
|
+
{
|
61
|
+
item_id: 1
|
62
|
+
},
|
63
|
+
{
|
64
|
+
item_id: 2
|
65
|
+
}
|
66
|
+
]
|
67
|
+
}
|
68
|
+
}
|
69
|
+
end
|
50
70
|
|
51
|
-
|
52
|
-
|
53
|
-
include Looksist
|
71
|
+
inject after: :metrics, at: '$.table.menu', using: :item_id, populate: :item_name, bucket_name: 'menu_items'
|
72
|
+
end
|
54
73
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
74
|
+
expect(@mock).to receive(:mget).once.with(*%w(menu_items/1 menu_items/2)).and_return(%w(Idly Pongal))
|
75
|
+
|
76
|
+
expect(CustomizedMenu.new.metrics).to eq({
|
77
|
+
table: {
|
78
|
+
menu: [{
|
79
|
+
item_id: 1,
|
80
|
+
item_name: 'Idly'
|
81
|
+
},
|
82
|
+
{
|
83
|
+
item_id: 2,
|
84
|
+
item_name: 'Pongal'
|
85
|
+
}]
|
86
|
+
}
|
87
|
+
})
|
88
|
+
end
|
89
|
+
|
90
|
+
xit 'should be capable to deep lookup and inject - another example' do
|
91
|
+
class NewMenu
|
92
|
+
include Looksist
|
93
|
+
|
94
|
+
def metrics
|
95
|
+
{
|
96
|
+
table: {
|
97
|
+
menu: [
|
98
|
+
{
|
99
|
+
item_id: 4,
|
100
|
+
item_name: 'Idly'
|
101
|
+
},
|
102
|
+
{
|
103
|
+
item_id: 5
|
104
|
+
}
|
105
|
+
]
|
106
|
+
}
|
107
|
+
}
|
108
|
+
end
|
109
|
+
|
110
|
+
inject after: :metrics, at: '$.table.menu[?(@.item_id=5)]', using: :item_id, populate: :item_name
|
68
111
|
end
|
69
112
|
|
70
|
-
|
113
|
+
expect(@mock).to receive(:get).with('items/5').and_return(OpenStruct.new(value: 'Pongal'))
|
114
|
+
|
115
|
+
expect(NewMenu.new.metrics).to eq(
|
116
|
+
{
|
117
|
+
table: {
|
118
|
+
menu: [
|
119
|
+
{
|
120
|
+
item_id: 4,
|
121
|
+
item_name: 'Idly'
|
122
|
+
},
|
123
|
+
{
|
124
|
+
item_id: 5,
|
125
|
+
item_name: 'Pongal'
|
126
|
+
}
|
127
|
+
]
|
128
|
+
}
|
129
|
+
}
|
130
|
+
)
|
71
131
|
end
|
72
132
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
table: {
|
77
|
-
menu: [{
|
78
|
-
item_id: 1,
|
79
|
-
item_name: 'Idly'
|
80
|
-
},
|
81
|
-
{
|
82
|
-
item_id: 2,
|
83
|
-
item_name: 'Pongal'
|
84
|
-
}]
|
85
|
-
}
|
86
|
-
})
|
87
|
-
end
|
133
|
+
it 'should be capable to deep lookup and inject on columnar hashes' do
|
134
|
+
class DeepHash
|
135
|
+
include Looksist
|
88
136
|
|
89
|
-
|
90
|
-
|
91
|
-
|
137
|
+
def metrics
|
138
|
+
{
|
139
|
+
table: {
|
140
|
+
inner_table: {
|
141
|
+
employee_id: [10, 20]
|
142
|
+
}
|
143
|
+
}
|
144
|
+
}
|
145
|
+
end
|
92
146
|
|
93
|
-
|
94
|
-
{
|
95
|
-
table: {
|
96
|
-
menu: [
|
97
|
-
{
|
98
|
-
item_id: 4,
|
99
|
-
item_name: 'Idly'
|
100
|
-
},
|
101
|
-
{
|
102
|
-
item_id: 5
|
103
|
-
}
|
104
|
-
]
|
105
|
-
}
|
106
|
-
}
|
147
|
+
inject after: :metrics, at: '$.table.inner_table', using: :employee_id, populate: :employee_name
|
107
148
|
end
|
108
149
|
|
109
|
-
|
150
|
+
expect(@mock).to receive(:mget).with(*%w(employees/10 employees/20)).and_return(['emp 1', 'emp 2'])
|
151
|
+
|
152
|
+
expect(DeepHash.new.metrics).to eq({table: {
|
153
|
+
inner_table: {
|
154
|
+
employee_id: [10, 20],
|
155
|
+
employee_name: ['emp 1', 'emp 2']
|
156
|
+
}
|
157
|
+
}})
|
110
158
|
end
|
111
159
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
{
|
116
|
-
table: {
|
117
|
-
menu: [
|
118
|
-
{
|
119
|
-
item_id: 4,
|
120
|
-
item_name: 'Idly'
|
121
|
-
},
|
122
|
-
{
|
123
|
-
item_id: 5,
|
124
|
-
item_name: 'Pongal'
|
125
|
-
}
|
126
|
-
]
|
127
|
-
}
|
128
|
-
}
|
129
|
-
)
|
130
|
-
end
|
160
|
+
it 'should inject single attribute to an existing hash' do
|
161
|
+
class HashService1
|
162
|
+
include Looksist
|
131
163
|
|
132
|
-
|
133
|
-
|
134
|
-
|
164
|
+
def metrics
|
165
|
+
{
|
166
|
+
table: {
|
167
|
+
employee_id: [1, 2]
|
168
|
+
}
|
169
|
+
}
|
170
|
+
end
|
135
171
|
|
136
|
-
|
137
|
-
{
|
138
|
-
table: {
|
139
|
-
inner_table: {
|
140
|
-
employee_id: [10, 20]
|
141
|
-
}
|
142
|
-
}
|
143
|
-
}
|
172
|
+
inject after: :metrics, at: :table, using: :employee_id, populate: :employee_name
|
144
173
|
end
|
145
174
|
|
146
|
-
|
147
|
-
end
|
175
|
+
expect(@mock).to receive(:mget).with(*%w(employees/1 employees/2)).and_return(['emp 1', 'emp 2'])
|
148
176
|
|
149
|
-
|
177
|
+
expect(HashService1.new.metrics).to eq({table: {
|
178
|
+
employee_id: [1, 2],
|
179
|
+
employee_name: ['emp 1', 'emp 2']
|
180
|
+
}})
|
181
|
+
end
|
150
182
|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
employee_name: ['emp 1', 'emp 2']
|
155
|
-
}
|
156
|
-
}})
|
157
|
-
end
|
183
|
+
it 'should inject multiple attribute to an existing hash' do
|
184
|
+
class HashService
|
185
|
+
include Looksist
|
158
186
|
|
159
|
-
|
160
|
-
|
161
|
-
|
187
|
+
def metrics
|
188
|
+
{
|
189
|
+
table: {
|
190
|
+
employee_id: [5, 6],
|
191
|
+
employer_id: [3, 4]
|
192
|
+
}
|
193
|
+
}
|
194
|
+
end
|
162
195
|
|
163
|
-
|
164
|
-
|
165
|
-
table: {
|
166
|
-
employee_id: [1, 2]
|
167
|
-
}
|
168
|
-
}
|
196
|
+
inject after: :metrics, at: :table, using: :employee_id, populate: :employee_name
|
197
|
+
inject after: :metrics, at: :table, using: :employer_id, populate: :employer_name
|
169
198
|
end
|
170
199
|
|
171
|
-
|
172
|
-
end
|
200
|
+
expect(@mock).to receive(:mget).with(*%w(employees/5 employees/6)).and_return(['emp 5', 'emp 6'])
|
173
201
|
|
174
|
-
|
202
|
+
expect(@mock).to receive(:mget).with(*%w(employers/3 employers/4)).and_return(['empr 3', 'empr 4'])
|
175
203
|
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
204
|
+
expect(HashService.new.metrics).to eq({table: {
|
205
|
+
employee_id: [5, 6],
|
206
|
+
employer_id: [3, 4],
|
207
|
+
employee_name: ['emp 5', 'emp 6'],
|
208
|
+
employer_name: ['empr 3', 'empr 4']
|
209
|
+
}})
|
210
|
+
end
|
180
211
|
end
|
181
212
|
|
182
|
-
it 'should inject multiple attribute to an existing hash' do
|
183
|
-
class
|
213
|
+
it 'should inject multiple attribute to an existing deep hash' do
|
214
|
+
class EmployeeHash
|
184
215
|
include Looksist
|
185
216
|
|
186
217
|
def metrics
|
187
218
|
{
|
188
219
|
table: {
|
189
|
-
|
190
|
-
|
220
|
+
database: {
|
221
|
+
employee_id: [15, 16],
|
222
|
+
employer_id: [13, 14]
|
223
|
+
}
|
191
224
|
}
|
192
225
|
}
|
193
226
|
end
|
194
227
|
|
195
|
-
inject after: :metrics, at:
|
196
|
-
inject after: :metrics, at:
|
228
|
+
inject after: :metrics, at: '$.table.database', using: :employee_id, populate: :employee_name
|
229
|
+
inject after: :metrics, at: '$.table.database', using: :employer_id, populate: :employer_name
|
197
230
|
end
|
198
231
|
|
199
|
-
expect(@mock).to receive(:mget).with(*%w(employees/
|
232
|
+
expect(@mock).to receive(:mget).with(*%w(employees/15 employees/16)).and_return(['emp 15', 'emp 16'])
|
200
233
|
|
201
|
-
expect(@mock).to receive(:mget).with(*%w(employers/
|
234
|
+
expect(@mock).to receive(:mget).with(*%w(employers/13 employers/14)).and_return(['empr 13', 'empr 14'])
|
202
235
|
|
203
|
-
expect(
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
236
|
+
expect(EmployeeHash.new.metrics).to eq({table: {
|
237
|
+
database: {
|
238
|
+
employee_id: [15, 16],
|
239
|
+
employer_id: [13, 14],
|
240
|
+
employee_name: ['emp 15', 'emp 16'],
|
241
|
+
employer_name: ['empr 13', 'empr 14']
|
242
|
+
}
|
208
243
|
}})
|
209
244
|
end
|
210
|
-
end
|
211
|
-
|
212
|
-
it 'should inject multiple attribute to an existing deep hash' do
|
213
|
-
class EmployeeHash
|
214
|
-
include Looksist
|
215
|
-
|
216
|
-
def metrics
|
217
|
-
{
|
218
|
-
table: {
|
219
|
-
database: {
|
220
|
-
employee_id: [15, 16],
|
221
|
-
employer_id: [13, 14]
|
222
|
-
}
|
223
|
-
}
|
224
|
-
}
|
225
|
-
end
|
226
245
|
|
227
|
-
|
228
|
-
|
229
|
-
|
246
|
+
context 'handle no data' do
|
247
|
+
it 'should not inject when data is not available' do
|
248
|
+
class EmptyResponse
|
249
|
+
include Looksist
|
230
250
|
|
231
|
-
|
251
|
+
def empty
|
252
|
+
{:high_stock => {}, :low_shelf_life => {}, :in_elimination => {}, :inactive_with_stock => {}}
|
253
|
+
end
|
232
254
|
|
233
|
-
|
255
|
+
inject after: :empty, at: :high_stock,
|
256
|
+
using: :sub_category_id, populate: :sub_category
|
234
257
|
|
235
|
-
|
236
|
-
|
237
|
-
employee_id: [15, 16],
|
238
|
-
employer_id: [13, 14],
|
239
|
-
employee_name: ['emp 15', 'emp 16'],
|
240
|
-
employer_name: ['empr 13', 'empr 14']
|
241
|
-
}
|
242
|
-
}})
|
243
|
-
end
|
258
|
+
inject after: :empty, at: '$.low_shelf_life',
|
259
|
+
using: :sub_category_id, populate: :sub_category
|
244
260
|
|
245
|
-
|
246
|
-
|
247
|
-
class EmptyResponse
|
248
|
-
include Looksist
|
261
|
+
inject after: :empty, at: '$.in_elimination',
|
262
|
+
using: :sub_category_id, populate: :sub_category
|
249
263
|
|
250
|
-
|
251
|
-
|
264
|
+
inject after: :empty, at: '$.inactive_with_stock',
|
265
|
+
using: :sub_category_id, populate: :sub_category
|
252
266
|
end
|
267
|
+
expected_response = {:high_stock => {}, :low_shelf_life => {}, :in_elimination => {}, :inactive_with_stock => {}}
|
268
|
+
expect(EmptyResponse.new.empty).to eq(expected_response)
|
269
|
+
end
|
253
270
|
|
254
|
-
|
255
|
-
|
271
|
+
it 'should be capable to deep lookup and inject' do
|
272
|
+
class EmptyMenu
|
273
|
+
include Looksist
|
256
274
|
|
257
|
-
|
258
|
-
|
275
|
+
def metrics
|
276
|
+
{
|
277
|
+
table: {
|
278
|
+
menu: []
|
279
|
+
}
|
280
|
+
}
|
281
|
+
end
|
259
282
|
|
260
|
-
|
261
|
-
|
283
|
+
inject after: :metrics, at: '$.table.menu', using: :item_id, populate: :item_name
|
284
|
+
end
|
262
285
|
|
263
|
-
|
264
|
-
|
286
|
+
expect(EmptyMenu.new.metrics).to eq({
|
287
|
+
table: {
|
288
|
+
menu: []
|
289
|
+
}
|
290
|
+
})
|
265
291
|
end
|
266
|
-
expected_response = {:high_stock => {}, :low_shelf_life => {}, :in_elimination => {}, :inactive_with_stock => {}}
|
267
|
-
expect(EmptyResponse.new.empty).to eq(expected_response)
|
268
292
|
end
|
269
293
|
|
270
|
-
it 'should be capable to deep lookup and inject' do
|
271
|
-
class EmptyMenu
|
272
|
-
include Looksist
|
273
294
|
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
295
|
+
context 'multiple methods and injections' do
|
296
|
+
it 'should inject multiple attribute to an existing hash' do
|
297
|
+
class HashServiceSuper
|
298
|
+
include Looksist
|
299
|
+
|
300
|
+
def shrinkage
|
301
|
+
{
|
302
|
+
table: {
|
303
|
+
shrink_id: [1, 2]
|
304
|
+
}
|
305
|
+
}
|
306
|
+
end
|
307
|
+
|
308
|
+
def stock
|
309
|
+
{
|
310
|
+
table: {
|
311
|
+
dc_id: [7, 8]
|
312
|
+
}
|
313
|
+
}
|
314
|
+
end
|
315
|
+
|
316
|
+
inject after: :shrinkage, at: :table, using: :shrink_id, populate: :shrink_name
|
317
|
+
inject after: :stock, at: :table, using: :dc_id, populate: :dc_name
|
280
318
|
end
|
281
319
|
|
282
|
-
|
283
|
-
end
|
320
|
+
expect(@mock).to receive(:mget).with(*%w(shrinks/1 shrinks/2)).and_return(['shrink 1', 'shrink 2'])
|
284
321
|
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
322
|
+
expect(@mock).to receive(:mget).with(*%w(dcs/7 dcs/8)).and_return(['dc 7', 'dc 8'])
|
323
|
+
|
324
|
+
hash_service_super = HashServiceSuper.new
|
325
|
+
expect(hash_service_super.shrinkage).to eq({table: {
|
326
|
+
shrink_id: [1, 2],
|
327
|
+
shrink_name: ['shrink 1', 'shrink 2']
|
328
|
+
}})
|
329
|
+
|
330
|
+
expect(hash_service_super.stock).to eq({table: {
|
331
|
+
dc_id: [7, 8],
|
332
|
+
dc_name: ['dc 7', 'dc 8']
|
333
|
+
}})
|
334
|
+
end
|
290
335
|
end
|
291
336
|
end
|
292
337
|
|
338
|
+
context('no l2 cache') do
|
339
|
+
before(:each) do
|
340
|
+
@mock = {}
|
341
|
+
Looksist.configure do |looksist|
|
342
|
+
looksist.lookup_store = @mock
|
343
|
+
looksist.cache_buffer_size = 10
|
344
|
+
looksist.l2_cache = :no_cache
|
345
|
+
end
|
346
|
+
end
|
293
347
|
|
294
|
-
|
295
|
-
|
296
|
-
class HashServiceSuper
|
348
|
+
it 'should be capable to deep lookup and inject on columnar hashes' do
|
349
|
+
class NoL2DeepHash
|
297
350
|
include Looksist
|
298
351
|
|
299
|
-
def
|
300
|
-
{
|
301
|
-
table: {
|
302
|
-
shrink_id: [1, 2]
|
303
|
-
}
|
304
|
-
}
|
305
|
-
end
|
306
|
-
|
307
|
-
def stock
|
352
|
+
def metrics
|
308
353
|
{
|
309
354
|
table: {
|
310
|
-
|
355
|
+
inner_table: {
|
356
|
+
employee_id: [10, 10]
|
357
|
+
}
|
311
358
|
}
|
312
359
|
}
|
313
360
|
end
|
314
361
|
|
315
|
-
inject after: :
|
316
|
-
inject after: :stock, at: :table, using: :dc_id, populate: :dc_name
|
362
|
+
inject after: :metrics, at: '$.table.inner_table', using: :employee_id, populate: :employee_name
|
317
363
|
end
|
318
364
|
|
319
|
-
expect(@mock).to receive(:mget).with(*%w(
|
365
|
+
expect(@mock).to receive(:mget).with(*%w(employees/10)).and_return(['emp 1'])
|
320
366
|
|
321
|
-
expect(
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
shrink_name: ['shrink 1', 'shrink 2']
|
327
|
-
}})
|
328
|
-
|
329
|
-
expect(hash_service_super.stock).to eq({table: {
|
330
|
-
dc_id: [7, 8],
|
331
|
-
dc_name: ['dc 7', 'dc 8']
|
367
|
+
expect(NoL2DeepHash.new.metrics).to eq({table: {
|
368
|
+
inner_table: {
|
369
|
+
employee_id: [10, 10],
|
370
|
+
employee_name: ['emp 1', 'emp 1']
|
371
|
+
}
|
332
372
|
}})
|
333
373
|
end
|
334
374
|
end
|