summaryrefslogtreecommitdiffhomepage
path: root/test/workbook/worksheet/tc_pivot_table.rb
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-05-22 20:13:13 +0200
committerGeremia Taglialatela <[email protected]>2023-05-22 20:13:13 +0200
commit083c4c6d62011cd88966d608b0c6bb736f300a0c (patch)
treeb5ceb9b3a32c4130d84c3075966b4033bf32a118 /test/workbook/worksheet/tc_pivot_table.rb
parent6752225bbb8a9eec905ec02a98f1a25a309c404a (diff)
downloadcaxlsx-083c4c6d62011cd88966d608b0c6bb736f300a0c.tar.gz
caxlsx-083c4c6d62011cd88966d608b0c6bb736f300a0c.zip
Use Ruby 1.9 hash syntax (non-production code)
Diffstat (limited to 'test/workbook/worksheet/tc_pivot_table.rb')
-rw-r--r--test/workbook/worksheet/tc_pivot_table.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/workbook/worksheet/tc_pivot_table.rb b/test/workbook/worksheet/tc_pivot_table.rb
index f5b23a96..606982db 100644
--- a/test/workbook/worksheet/tc_pivot_table.rb
+++ b/test/workbook/worksheet/tc_pivot_table.rb
@@ -60,22 +60,22 @@ class TestPivotTable < Test::Unit::TestCase
assert_equal(['Year', 'Month'], pivot_table.rows)
assert_equal(['Type'], pivot_table.columns)
- assert_equal([{ :ref => "Sales" }], pivot_table.data)
+ assert_equal([{ ref: "Sales" }], pivot_table.data)
assert_equal(['Region'], pivot_table.pages)
shared_test_pivot_table_xml_validity(pivot_table)
end
def test_add_pivot_table_with_options_on_data_field
pivot_table = @ws.add_pivot_table('G5:G6', 'A1:D5') do |pt|
- pt.data = [{ :ref => "Sales", :subtotal => 'average' }]
+ pt.data = [{ ref: "Sales", subtotal: 'average' }]
end
- assert_equal([{ :ref => "Sales", :subtotal => 'average' }], pivot_table.data)
+ assert_equal([{ ref: "Sales", subtotal: 'average' }], pivot_table.data)
end
def test_add_pivot_table_with_style_info
- style_info_data = { :name => "PivotStyleMedium9", :showRowHeaders => "1", :showLastColumn => "0" }
- pivot_table = @ws.add_pivot_table('G5:G6', 'A1:E5', { :style_info => style_info_data }) do |pt|
+ style_info_data = { name: "PivotStyleMedium9", showRowHeaders: "1", showLastColumn: "0" }
+ pivot_table = @ws.add_pivot_table('G5:G6', 'A1:E5', { style_info: style_info_data }) do |pt|
pt.rows = ['Year', 'Month']
pt.columns = ['Type']
pt.data = ['Sales']
@@ -87,7 +87,7 @@ class TestPivotTable < Test::Unit::TestCase
end
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|
+ 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
@@ -96,7 +96,7 @@ class TestPivotTable < Test::Unit::TestCase
end
def test_add_pivot_table_with_months_sorted
- pivot_table = @ws.add_pivot_table('G5:G6', 'A1:E5', { :sort_on_headers => ['Month'] }) do |pt|
+ pivot_table = @ws.add_pivot_table('G5:G6', 'A1:E5', { sort_on_headers: ['Month'] }) do |pt|
pt.data = ['Sales']
pt.rows = ['Year', 'Month']
end
@@ -145,7 +145,7 @@ class TestPivotTable < Test::Unit::TestCase
end
def test_to_xml_string
- pivot_table = @ws.add_pivot_table('G5:G6', 'A1:E5', { :no_subtotals_on_headers => ['Year'] }) do |pt|
+ pivot_table = @ws.add_pivot_table('G5:G6', 'A1:E5', { no_subtotals_on_headers: ['Year'] }) do |pt|
pt.rows = ['Year', 'Month']
pt.columns = ['Type']
pt.data = ['Sales']
@@ -156,14 +156,14 @@ class TestPivotTable < Test::Unit::TestCase
def test_to_xml_string_with_options_on_data_field
pivot_table = @ws.add_pivot_table('G5:G6', 'A1:E5') do |pt|
- pt.data = [{ :ref => "Sales", :subtotal => 'average' }]
+ pt.data = [{ ref: "Sales", subtotal: 'average' }]
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 }]
+ pt.data = [{ ref: "Sales", subtotal: 'sum', num_fmt: 4 }]
end
doc = Nokogiri::XML(pivot_table.to_xml_string)