Navigation Menu

Skip to content

Commit

Permalink
test: fix names
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Oct 6, 2015
1 parent 5c9d6f3 commit 5ccd3c4
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions test/test-table-group.rb
Expand Up @@ -325,11 +325,12 @@ def setup_memos
def test_max
grouped_records = @memos.group("tag",
:calc_target => "priority",
:calc_types => [:max]).collect do |group|
tag = group.key
:calc_types => [:max])
grouped_data = grouped_records.collect do |record|
tag = record.key
[
tag.key,
group.max,
record.max,
]
end

Expand All @@ -338,20 +339,21 @@ def test_max
["Mroonga", 50],
["Rroonga", 25],
],
grouped_records)
grouped_data)
end

def test_all_types
grouped_records = @memos.group("tag",
:calc_target => "priority",
:calc_types => [:max, :min, :sum, :average]).collect do |group|
tag = group.key
:calc_types => [:max, :min, :sum, :average])
grouped_data = grouped_records.collect do |record|
tag = record.key
[
tag.key,
group.max,
group.min,
group.sum,
group.average.round(3),
record.max,
record.min,
record.sum,
record.average.round(3),
]
end

Expand All @@ -360,7 +362,7 @@ def test_all_types
["Mroonga", 50, 10, 85, 28.333],
["Rroonga", 25, -25, 0, 0.0],
],
grouped_records)
grouped_data)
end
end
end

0 comments on commit 5ccd3c4

Please sign in to comment.