Skip to content

Commit

Permalink
Merge pull request #58 from kbrock/division_by_zero_test
Browse files Browse the repository at this point in the history
Add test to ensure mean doesn't divide by zero
  • Loading branch information
kbrock committed Jun 5, 2020
2 parents 3e1facd + abb9402 commit f9dc2a9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/table_pivot_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ def test_produces_correct_full_table
assert_equal(expected, @pivoted)
end

def test_pivot_empty_table
tab = Ruport.Table ["id", "num_sessions", "status", "diagnosis"]
tab << ["one", 10, :aborted, :good]
tab << ["two", 10, :success, :bad]

tab.pivot("status", :group_by=>"diagnosis", :values=>"num_sessions", :operation=>:mean)
end
end

class PivotConvertRowOrderToGroupOrderTest < Minitest::Test
Expand Down

0 comments on commit f9dc2a9

Please sign in to comment.