summaryrefslogtreecommitdiffhomepage
path: root/test/workbook/worksheet/tc_pivot_table.rb
diff options
context:
space:
mode:
authorEvan Hallmark <[email protected]>2016-11-07 11:49:58 -0800
committerEvan Hallmark <[email protected]>2016-11-07 11:49:58 -0800
commit5d42f7708f7d3f1c25e9f31ff13db58679c1dcb7 (patch)
tree6f2a73aecd4464788ba03c300870796208192d60 /test/workbook/worksheet/tc_pivot_table.rb
parent31a4e6cb13d139c7d54038ecb204b4ae1b152c61 (diff)
downloadcaxlsx-5d42f7708f7d3f1c25e9f31ff13db58679c1dcb7.tar.gz
caxlsx-5d42f7708f7d3f1c25e9f31ff13db58679c1dcb7.zip
Added pivot table option to pass in list of row fields to omit subtotals from
Diffstat (limited to 'test/workbook/worksheet/tc_pivot_table.rb')
-rw-r--r--test/workbook/worksheet/tc_pivot_table.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/workbook/worksheet/tc_pivot_table.rb b/test/workbook/worksheet/tc_pivot_table.rb
index 3c42d605..a62e6f40 100644
--- a/test/workbook/worksheet/tc_pivot_table.rb
+++ b/test/workbook/worksheet/tc_pivot_table.rb
@@ -67,7 +67,15 @@ class TestPivotTable < Test::Unit::TestCase
assert_equal([{:ref=>"Sales", :subtotal => 'average'}], pivot_table.data)
end
- def test_header_indices
+ def test_add_pivot_table_with_row_without_subtotals
+ pivot_table = @ws.add_pivot_table('G5:G6', 'A1:D5', {:no_subtotals_on_headers=>['Year']}) do |pt|
+ pt.data = ['Sales']
+ pt.rows = ['Year','Month']
+ end
+ assert_equal(['Year'], pivot_table.no_subtotals_on_headers)
+ end
+
+ def test_header_indices
pivot_table = @ws.add_pivot_table('G5:G6', 'A1:E5')
assert_equal(0, pivot_table.header_index_of('Year' ))
assert_equal(1, pivot_table.header_index_of('Month' ))