summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorKnut I. Stenmark <[email protected]>2021-03-19 11:47:49 +0100
committerGitHub <[email protected]>2021-03-19 11:47:49 +0100
commit33e2771710a1f0a7740d15cf0b9925f9079d486b (patch)
tree87cb7e89e0da6000ddaadbad445e5cde23e56e7f /test
parent927849bb091f9858fe54d2b48742aa531f21dfb3 (diff)
downloadcaxlsx-33e2771710a1f0a7740d15cf0b9925f9079d486b.tar.gz
caxlsx-33e2771710a1f0a7740d15cf0b9925f9079d486b.zip
Add support for format in pivot tables (#79)
Diffstat (limited to 'test')
-rw-r--r--test/workbook/worksheet/tc_pivot_table.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/workbook/worksheet/tc_pivot_table.rb b/test/workbook/worksheet/tc_pivot_table.rb
index 6d7f4d1c..a494dcfd 100644
--- a/test/workbook/worksheet/tc_pivot_table.rb
+++ b/test/workbook/worksheet/tc_pivot_table.rb
@@ -132,4 +132,12 @@ class TestPivotTable < Test::Unit::TestCase
end
shared_test_pivot_table_xml_validity(pivot_table)
end
+
+ def test_add_pivot_table_with_format_options_on_data_field
+ pivot_table = @ws.add_pivot_table('G5:G6', 'A1:E5') do |pt|
+ pt.data = [{:ref=>"Sales", :subtotal => 'sum', num_fmt: 4}]
+ end
+ doc = Nokogiri::XML(pivot_table.to_xml_string)
+ assert_equal('4', doc.at_css('dataFields dataField')['numFmtId'], 'adding format options to pivot_table')
+ end
end