mochigome 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mochigome_ver.rb +1 -1
- data/lib/query.rb +1 -1
- data/test/unit/query_test.rb +18 -0
- metadata +4 -4
data/lib/mochigome_ver.rb
CHANGED
data/lib/query.rb
CHANGED
data/test/unit/query_test.rb
CHANGED
@@ -207,6 +207,24 @@ describe Mochigome::Query do
|
|
207
207
|
assert_equal 24, data_node['Sales count']
|
208
208
|
end
|
209
209
|
|
210
|
+
it "collects aggregate data on layers above the focus when given no condition" do
|
211
|
+
q = Mochigome::Query.new(
|
212
|
+
[Owner, Store, Product],
|
213
|
+
:aggregate_sources => [[Product, Sale]]
|
214
|
+
)
|
215
|
+
|
216
|
+
tbl = Arel::Table.new(Owner.table_name)
|
217
|
+
data_node = q.run
|
218
|
+
|
219
|
+
assert_equal "Jane's Store (North)", (data_node/1/0).name
|
220
|
+
assert_equal 11, (data_node/1/0)['Sales count']
|
221
|
+
|
222
|
+
assert_equal "Jane Doe", (data_node/1).name
|
223
|
+
assert_equal 16, (data_node/1)['Sales count']
|
224
|
+
|
225
|
+
assert_equal 24, data_node['Sales count']
|
226
|
+
end
|
227
|
+
|
210
228
|
it "can do conditional counts" do
|
211
229
|
q = Mochigome::Query.new(
|
212
230
|
[Category],
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mochigome
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- David Mike Simon
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-03-
|
18
|
+
date: 2012-03-03 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|