summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorrandym <[email protected]>2018-02-08 21:56:12 +0900
committerrandym <[email protected]>2018-02-08 21:56:12 +0900
commit71dba5a4154edf4939c9537901cbf9217a896515 (patch)
treeb3693a4aac8ef1703ea2f593a03e9c735d764ded /test
parent747ff93269c518db21c9869b61b1d1470395b502 (diff)
downloadcaxlsx-71dba5a4154edf4939c9537901cbf9217a896515.tar.gz
caxlsx-71dba5a4154edf4939c9537901cbf9217a896515.zip
chore(coverage): 100% coverage, 100% docs
Diffstat (limited to 'test')
-rw-r--r--test/drawing/tc_drawing.rb4
-rw-r--r--test/workbook/worksheet/tc_pivot_table.rb7
-rw-r--r--test/workbook/worksheet/tc_table.rb5
-rw-r--r--test/workbook/worksheet/tc_worksheet.rb10
4 files changed, 10 insertions, 16 deletions
diff --git a/test/drawing/tc_drawing.rb b/test/drawing/tc_drawing.rb
index 7014f1b2..c9095fe7 100644
--- a/test/drawing/tc_drawing.rb
+++ b/test/drawing/tc_drawing.rb
@@ -59,9 +59,9 @@ class TestDrawing < Test::Unit::TestCase
end
def test_relationships
- chart = @ws.add_chart(Axlsx::Pie3DChart, :title=>"bob", :start_at=>[0,0], :end_at=>[1,1])
+ @ws.add_chart(Axlsx::Pie3DChart, :title=>"bob", :start_at=>[0,0], :end_at=>[1,1])
assert_equal(@ws.drawing.relationships.size, 1, "adding a chart adds a relationship")
- chart = @ws.add_chart(Axlsx::Pie3DChart, :title=>"nancy", :start_at=>[1,5], :end_at=>[5,10])
+ @ws.add_chart(Axlsx::Pie3DChart, :title=>"nancy", :start_at=>[1,5], :end_at=>[5,10])
assert_equal(@ws.drawing.relationships.size, 2, "adding a chart adds a relationship")
end
diff --git a/test/workbook/worksheet/tc_pivot_table.rb b/test/workbook/worksheet/tc_pivot_table.rb
index ff7f8b92..6d7f4d1c 100644
--- a/test/workbook/worksheet/tc_pivot_table.rb
+++ b/test/workbook/worksheet/tc_pivot_table.rb
@@ -117,12 +117,7 @@ class TestPivotTable < Test::Unit::TestCase
end
def test_to_xml_string
- pivot_table = @ws.add_pivot_table('G5:G6', 'A1:D5')
- shared_test_pivot_table_xml_validity(pivot_table)
- end
-
- def test_to_xml_string_with_configuration
- pivot_table = @ws.add_pivot_table('G5:G6', 'A1:E5') 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']
diff --git a/test/workbook/worksheet/tc_table.rb b/test/workbook/worksheet/tc_table.rb
index 6f39bb13..8edfc099 100644
--- a/test/workbook/worksheet/tc_table.rb
+++ b/test/workbook/worksheet/tc_table.rb
@@ -47,9 +47,9 @@ class TestTable < Test::Unit::TestCase
def test_relationships
assert(@ws.relationships.empty?)
- table = @ws.add_table("A1:D5")
+ @ws.add_table("A1:D5")
assert_equal(@ws.relationships.size, 1, "adding a table adds a relationship")
- table = @ws.add_table("F1:J5")
+ @ws.add_table("F1:J5")
assert_equal(@ws.relationships.size, 2, "adding a table adds a relationship")
end
@@ -64,5 +64,4 @@ class TestTable < Test::Unit::TestCase
end
assert(errors.empty?, "error free validation")
end
-
end
diff --git a/test/workbook/worksheet/tc_worksheet.rb b/test/workbook/worksheet/tc_worksheet.rb
index c7e963f5..fa8832d8 100644
--- a/test/workbook/worksheet/tc_worksheet.rb
+++ b/test/workbook/worksheet/tc_worksheet.rb
@@ -437,15 +437,15 @@ class TestWorksheet < Test::Unit::TestCase
def test_relationships
@ws.add_row [1,2,3]
assert(@ws.relationships.empty?, "No Drawing relationship until you add a chart")
- c = @ws.add_chart Axlsx::Pie3DChart
+ @ws.add_chart Axlsx::Pie3DChart
assert_equal(@ws.relationships.size, 1, "adding a chart creates the relationship")
- c = @ws.add_chart Axlsx::Pie3DChart
+ @ws.add_chart Axlsx::Pie3DChart
assert_equal(@ws.relationships.size, 1, "multiple charts still only result in one relationship")
- c = @ws.add_comment :text => 'builder', :author => 'bob', :ref => @ws.rows.last.cells.last
+ @ws.add_comment :text => 'builder', :author => 'bob', :ref => @ws.rows.last.cells.last
assert_equal(@ws.relationships.size, 3, "adding a comment adds 2 relationships")
- c = @ws.add_comment :text => 'not that is a comment!', :author => 'travis', :ref => "A1"
+ @ws.add_comment :text => 'not that is a comment!', :author => 'travis', :ref => "A1"
assert_equal(@ws.relationships.size, 3, "adding multiple comments in the same worksheet should not add any additional comment relationships")
- c = @ws.add_pivot_table 'G5:G6', 'A1:D10'
+ @ws.add_pivot_table 'G5:G6', 'A1:D10'
assert_equal(@ws.relationships.size, 4, "adding a pivot table adds 1 relationship")
end