diff options
| author | Geremia Taglialatela <[email protected]> | 2023-04-08 00:12:18 +0200 |
|---|---|---|
| committer | Geremia Taglialatela <[email protected]> | 2023-04-08 00:12:18 +0200 |
| commit | 5d68145521afe5c5912ceebae2f7e784eb5f8954 (patch) | |
| tree | 5289c654cb213de98a6c812fbe581e2609f6615a /test/workbook/worksheet | |
| parent | 7f077b55bf963c6e855c6c9066c6aed4926fb8e3 (diff) | |
| download | caxlsx-5d68145521afe5c5912ceebae2f7e784eb5f8954.tar.gz caxlsx-5d68145521afe5c5912ceebae2f7e784eb5f8954.zip | |
Fix EmptyLines related offenses
Diffstat (limited to 'test/workbook/worksheet')
28 files changed, 0 insertions, 41 deletions
diff --git a/test/workbook/worksheet/auto_filter/tc_auto_filter.rb b/test/workbook/worksheet/auto_filter/tc_auto_filter.rb index d7d3b47c..60089d22 100644 --- a/test/workbook/worksheet/auto_filter/tc_auto_filter.rb +++ b/test/workbook/worksheet/auto_filter/tc_auto_filter.rb @@ -1,7 +1,6 @@ require 'tc_helper.rb' class TestAutoFilter < Test::Unit::TestCase - def setup ws = Axlsx::Package.new.workbook.add_worksheet 3.times { |index| ws.add_row [1*index,2*index,3*index] } diff --git a/test/workbook/worksheet/auto_filter/tc_filter_column.rb b/test/workbook/worksheet/auto_filter/tc_filter_column.rb index 934931fd..642b7b6e 100644 --- a/test/workbook/worksheet/auto_filter/tc_filter_column.rb +++ b/test/workbook/worksheet/auto_filter/tc_filter_column.rb @@ -1,7 +1,6 @@ require 'tc_helper.rb' class TestFilterColumn < Test::Unit::TestCase - def setup @filter_column = Axlsx::FilterColumn.new(0, :filters, :filter_items => [200]) end diff --git a/test/workbook/worksheet/tc_border_creator.rb b/test/workbook/worksheet/tc_border_creator.rb index 6a0f8424..eb27fe98 100644 --- a/test/workbook/worksheet/tc_border_creator.rb +++ b/test/workbook/worksheet/tc_border_creator.rb @@ -76,5 +76,4 @@ class TestBorderCreator < Test::Unit::TestCase assert_equal [:thick], @ws.styles.borders[4].prs.map(&:style).uniq assert_equal [:left], @ws.styles.borders[4].prs.map(&:name) end - end diff --git a/test/workbook/worksheet/tc_break.rb b/test/workbook/worksheet/tc_break.rb index 814a4878..884d9e01 100644 --- a/test/workbook/worksheet/tc_break.rb +++ b/test/workbook/worksheet/tc_break.rb @@ -1,7 +1,6 @@ require 'tc_helper.rb' class TestBreak < Test::Unit::TestCase - def setup @break = Axlsx::Break.new(:id => 1, :min => 1, :max => 10, :man => true, :pt => false) end diff --git a/test/workbook/worksheet/tc_cell.rb b/test/workbook/worksheet/tc_cell.rb index bdbfd59d..af3699ad 100644 --- a/test/workbook/worksheet/tc_cell.rb +++ b/test/workbook/worksheet/tc_cell.rb @@ -1,7 +1,6 @@ require 'tc_helper.rb' class TestCell < Test::Unit::TestCase - def setup p = Axlsx::Package.new p.use_shared_strings = true diff --git a/test/workbook/worksheet/tc_cfvo.rb b/test/workbook/worksheet/tc_cfvo.rb index d846f57d..71ba6bbc 100644 --- a/test/workbook/worksheet/tc_cfvo.rb +++ b/test/workbook/worksheet/tc_cfvo.rb @@ -27,5 +27,4 @@ class TestCfvo < Test::Unit::TestCase doc = Nokogiri::XML.parse(@cfvo.to_xml_string) assert doc.xpath(".//cfvo[@type='min'][@val=0][@gte=true]") end - end diff --git a/test/workbook/worksheet/tc_col.rb b/test/workbook/worksheet/tc_col.rb index 00c5f058..2f31d7a2 100644 --- a/test/workbook/worksheet/tc_col.rb +++ b/test/workbook/worksheet/tc_col.rb @@ -1,7 +1,6 @@ require 'tc_helper.rb' class TestCol < Test::Unit::TestCase - def setup @col = Axlsx::Col.new 1, 1 end @@ -89,5 +88,4 @@ class TestCol < Test::Unit::TestCase assert_equal(@col.style, 1) #TODO check that the style specified is actually in the styles xfs collection end - end diff --git a/test/workbook/worksheet/tc_color_scale.rb b/test/workbook/worksheet/tc_color_scale.rb index 56afe338..7f9e5def 100644 --- a/test/workbook/worksheet/tc_color_scale.rb +++ b/test/workbook/worksheet/tc_color_scale.rb @@ -55,5 +55,4 @@ class TestColorScale < Test::Unit::TestCase assert_equal(doc.xpath(".//colorScale//cfvo").size, 2) assert_equal(doc.xpath(".//colorScale//color").size, 2) end - end diff --git a/test/workbook/worksheet/tc_conditional_formatting.rb b/test/workbook/worksheet/tc_conditional_formatting.rb index d9652ebf..cc885255 100644 --- a/test/workbook/worksheet/tc_conditional_formatting.rb +++ b/test/workbook/worksheet/tc_conditional_formatting.rb @@ -1,7 +1,6 @@ require 'tc_helper.rb' class TestConditionalFormatting < Test::Unit::TestCase - def setup p = Axlsx::Package.new @ws = p.workbook.add_worksheet :name=>"hmmm" @@ -17,7 +16,6 @@ class TestConditionalFormatting < Test::Unit::TestCase end def test_add_as_rule - color_scale = Axlsx::ColorScale.new do |cs| cs.colors.first.rgb = "FFDFDFDF" cs.colors.last.rgb = "FF00FF00" @@ -57,11 +55,9 @@ class TestConditionalFormatting < Test::Unit::TestCase doc = Nokogiri::XML.parse(cfs.last.to_xml_string) assert_equal(doc.xpath(".//conditionalFormatting//cfRule//iconSet//cfvo").size, 3) assert_equal(doc.xpath(".//conditionalFormatting//cfRule//iconSet[@iconSet='5Rating']").size, 1) - end def test_add_as_hash - color_scale = Axlsx::ColorScale.new do |cs| cs.colors.first.rgb = "FFDFDFDF" cs.colors.last.rgb = "FF00FF00" @@ -97,7 +93,6 @@ class TestConditionalFormatting < Test::Unit::TestCase doc = Nokogiri::XML.parse(cfs.last.to_xml_string) assert_equal(doc.xpath(".//conditionalFormatting//cfRule//iconSet//cfvo").size, 3) assert_equal(doc.xpath(".//conditionalFormatting//cfRule//iconSet[@iconSet='5Rating']").size, 1) - end def test_single_rule @@ -220,5 +215,4 @@ class TestConditionalFormatting < Test::Unit::TestCase assert_nothing_raised { @cfr.timePeriod = :today } assert_equal(@cfr.timePeriod, :today) end - end diff --git a/test/workbook/worksheet/tc_data_bar.rb b/test/workbook/worksheet/tc_data_bar.rb index fe02976d..65995dd2 100644 --- a/test/workbook/worksheet/tc_data_bar.rb +++ b/test/workbook/worksheet/tc_data_bar.rb @@ -41,5 +41,4 @@ class TestDataBar < Test::Unit::TestCase assert_equal(doc.xpath(".//dataBar//cfvo").size, 2) assert_equal(doc.xpath(".//dataBar//color").size, 1) end - end diff --git a/test/workbook/worksheet/tc_data_validation.rb b/test/workbook/worksheet/tc_data_validation.rb index 1d55aca3..0d9a2eb0 100644 --- a/test/workbook/worksheet/tc_data_validation.rb +++ b/test/workbook/worksheet/tc_data_validation.rb @@ -274,6 +274,5 @@ class TestDataValidation < Test::Unit::TestCase def test_empty_attributes v = Axlsx::DataValidation.new assert_equal(nil, v.send(:get_valid_attributes)) - end end diff --git a/test/workbook/worksheet/tc_date_time_converter.rb b/test/workbook/worksheet/tc_date_time_converter.rb index 225c1893..fafd66c6 100644 --- a/test/workbook/worksheet/tc_date_time_converter.rb +++ b/test/workbook/worksheet/tc_date_time_converter.rb @@ -110,7 +110,6 @@ class TestDateTimeConverter < Test::Unit::TestCase end def test_timezone - utc = Time.utc 2012 # January 1st, 2012 at 0:00 UTC local = Time.parse "2012-01-01 09:00:00 +0900" @@ -119,5 +118,4 @@ class TestDateTimeConverter < Test::Unit::TestCase Axlsx::Workbook.date1904 = true assert_equal Axlsx::DateTimeConverter::time_to_serial(local) - local.utc_offset.to_f/86400, Axlsx::DateTimeConverter::time_to_serial(utc) end - end diff --git a/test/workbook/worksheet/tc_header_footer.rb b/test/workbook/worksheet/tc_header_footer.rb index fb95d7bf..1ecea096 100644 --- a/test/workbook/worksheet/tc_header_footer.rb +++ b/test/workbook/worksheet/tc_header_footer.rb @@ -1,7 +1,6 @@ require 'tc_helper' class TestHeaderFooter < Test::Unit::TestCase - def setup @p = Axlsx::Package.new ws = @p.workbook.add_worksheet :name => 'test' diff --git a/test/workbook/worksheet/tc_icon_set.rb b/test/workbook/worksheet/tc_icon_set.rb index 9096625a..483de228 100644 --- a/test/workbook/worksheet/tc_icon_set.rb +++ b/test/workbook/worksheet/tc_icon_set.rb @@ -41,5 +41,4 @@ class TestIconSet < Test::Unit::TestCase assert_equal(doc.xpath(".//iconSet[@iconSet='3TrafficLights1'][@percent=1][@reverse=0][@showValue=1]").size, 1) assert_equal(doc.xpath(".//iconSet//cfvo").size, 3) end - end diff --git a/test/workbook/worksheet/tc_page_margins.rb b/test/workbook/worksheet/tc_page_margins.rb index 96695846..c1f2a626 100644 --- a/test/workbook/worksheet/tc_page_margins.rb +++ b/test/workbook/worksheet/tc_page_margins.rb @@ -1,7 +1,6 @@ require 'tc_helper.rb' class TestPageMargins < Test::Unit::TestCase - def setup p = Axlsx::Package.new ws = p.workbook.add_worksheet :name=>"hmmm" diff --git a/test/workbook/worksheet/tc_page_setup.rb b/test/workbook/worksheet/tc_page_setup.rb index 8c566a61..c7cec18b 100644 --- a/test/workbook/worksheet/tc_page_setup.rb +++ b/test/workbook/worksheet/tc_page_setup.rb @@ -1,7 +1,6 @@ require 'tc_helper.rb' class TestPageSetup < Test::Unit::TestCase - def setup @p = Axlsx::Package.new ws = @p.workbook.add_worksheet :name => "hmmm" @@ -137,6 +136,5 @@ class TestPageSetup < Test::Unit::TestCase fits = @ps.fit_to :height => 7, :width => 2 assert_equal(fits, [2, 7]) assert_raise(ArgumentError) { puts @ps.fit_to(:width => true)} - end end diff --git a/test/workbook/worksheet/tc_pivot_table.rb b/test/workbook/worksheet/tc_pivot_table.rb index b3ca647e..e03c5599 100644 --- a/test/workbook/worksheet/tc_pivot_table.rb +++ b/test/workbook/worksheet/tc_pivot_table.rb @@ -181,7 +181,6 @@ class TestPivotTable < Test::Unit::TestCase assert_nil( doc.at_css('colItems i')['x']) assert_equal('1', doc.at_css('colItems i[i=1] x')['v']) assert_equal('2', doc.at_css('colItems i[i=2] x')['v']) - end def test_pivot_table_with_only_one_data_row diff --git a/test/workbook/worksheet/tc_print_options.rb b/test/workbook/worksheet/tc_print_options.rb index 32af9cd0..8dc2b804 100644 --- a/test/workbook/worksheet/tc_print_options.rb +++ b/test/workbook/worksheet/tc_print_options.rb @@ -1,7 +1,6 @@ require 'tc_helper.rb' class TestPrintOptions < Test::Unit::TestCase - def setup p = Axlsx::Package.new ws = p.workbook.add_worksheet :name => "hmmm" @@ -68,5 +67,4 @@ class TestPrintOptions < Test::Unit::TestCase assert_nothing_raised { @po.vertical_centered = true } assert_equal(@po.vertical_centered, true) end - end diff --git a/test/workbook/worksheet/tc_row.rb b/test/workbook/worksheet/tc_row.rb index e919b914..900e751e 100644 --- a/test/workbook/worksheet/tc_row.rb +++ b/test/workbook/worksheet/tc_row.rb @@ -1,7 +1,6 @@ require 'tc_helper.rb' class TestRow < Test::Unit::TestCase - def setup p = Axlsx::Package.new @ws = p.workbook.add_worksheet :name=>"hmmm" @@ -57,7 +56,6 @@ class TestRow < Test::Unit::TestCase r = @ws.add_row [1,2,3], :style=>[1] assert_equal(r.cells.first.style, 1, "only apply style to cells with at the same index of of the style array") assert_equal(r.cells.last.style, 0, "only apply style to cells with at the same index of of the style array") - end def test_array_to_cells_with_escape_formulas @@ -155,5 +153,4 @@ class TestRow < Test::Unit::TestCase assert_equal(c.value, index < offset ? nil : values[index - offset]) end end - end diff --git a/test/workbook/worksheet/tc_sheet_calc_pr.rb b/test/workbook/worksheet/tc_sheet_calc_pr.rb index 05b837cf..9473c94b 100644 --- a/test/workbook/worksheet/tc_sheet_calc_pr.rb +++ b/test/workbook/worksheet/tc_sheet_calc_pr.rb @@ -1,7 +1,6 @@ require 'tc_helper' class TestSheetCalcPr < Test::Unit::TestCase - def setup @sheet_calc_pr = Axlsx::SheetCalcPr.new(:full_calc_on_load => false) end diff --git a/test/workbook/worksheet/tc_sheet_format_pr.rb b/test/workbook/worksheet/tc_sheet_format_pr.rb index ec98988b..ef4eb0d8 100644 --- a/test/workbook/worksheet/tc_sheet_format_pr.rb +++ b/test/workbook/worksheet/tc_sheet_format_pr.rb @@ -1,7 +1,6 @@ require 'tc_helper.rb' class TestSheetFormatPr < Test::Unit::TestCase - def setup @options = { :base_col_width => 5, @@ -86,5 +85,4 @@ class TestSheetFormatPr < Test::Unit::TestCase assert doc.xpath("sheetFormatPr[@outline_level_row=0]") assert doc.xpath("sheetFormatPr[@outline_level_col=0]") end - end diff --git a/test/workbook/worksheet/tc_sheet_pr.rb b/test/workbook/worksheet/tc_sheet_pr.rb index e39c8bca..f6ffcfdb 100644 --- a/test/workbook/worksheet/tc_sheet_pr.rb +++ b/test/workbook/worksheet/tc_sheet_pr.rb @@ -1,7 +1,6 @@ require 'tc_helper.rb' class TestSheetPr < Test::Unit::TestCase - def setup worksheet = Axlsx::Package.new.workbook.add_worksheet @options = { diff --git a/test/workbook/worksheet/tc_sheet_protection.rb b/test/workbook/worksheet/tc_sheet_protection.rb index 78969d34..26297bc4 100644 --- a/test/workbook/worksheet/tc_sheet_protection.rb +++ b/test/workbook/worksheet/tc_sheet_protection.rb @@ -58,5 +58,4 @@ class TestSheetProtection < Test::Unit::TestCase assert(doc.xpath("//sheetProtection[@#{key.to_s.gsub(/_(.)/){ $1.upcase }}='#{value}']")) end end - end diff --git a/test/workbook/worksheet/tc_sheet_view.rb b/test/workbook/worksheet/tc_sheet_view.rb index 386777b2..a09287aa 100644 --- a/test/workbook/worksheet/tc_sheet_view.rb +++ b/test/workbook/worksheet/tc_sheet_view.rb @@ -208,5 +208,4 @@ class TestSheetView < Test::Unit::TestCase @sv.add_selection(:top_left, :active_cell => "A1") assert_equal('A1', @sv.selections[:top_left].active_cell) end - end diff --git a/test/workbook/worksheet/tc_table.rb b/test/workbook/worksheet/tc_table.rb index fd6c1923..1a90f0bc 100644 --- a/test/workbook/worksheet/tc_table.rb +++ b/test/workbook/worksheet/tc_table.rb @@ -12,7 +12,6 @@ class TestTable < Test::Unit::TestCase def test_initialization assert(@ws.workbook.tables.empty?) assert(@ws.tables.empty?) - end def test_table_style_info diff --git a/test/workbook/worksheet/tc_table_style_info.rb b/test/workbook/worksheet/tc_table_style_info.rb index 9ba03ea7..19beaaba 100644 --- a/test/workbook/worksheet/tc_table_style_info.rb +++ b/test/workbook/worksheet/tc_table_style_info.rb @@ -13,7 +13,6 @@ class TestTableStyleInfo < Test::Unit::TestCase :show_row_stripes => 1, :show_column_stripes => 1, :name => "TableStyleDark4" } - end def test_initialize diff --git a/test/workbook/worksheet/tc_worksheet.rb b/test/workbook/worksheet/tc_worksheet.rb index 529fab5d..c264ec83 100644 --- a/test/workbook/worksheet/tc_worksheet.rb +++ b/test/workbook/worksheet/tc_worksheet.rb @@ -130,7 +130,6 @@ class TestWorksheet < Test::Unit::TestCase assert_equal(header_footer[key], optioned.header_footer.send(key)) end assert_equal(optioned.name, 'bob') - end # def test_use_gridlines @@ -892,5 +891,4 @@ class TestWorksheet < Test::Unit::TestCase wb.styles.style_index.values.first ) end - end diff --git a/test/workbook/worksheet/tc_worksheet_hyperlink.rb b/test/workbook/worksheet/tc_worksheet_hyperlink.rb index f64dc6b1..98b6937b 100644 --- a/test/workbook/worksheet/tc_worksheet_hyperlink.rb +++ b/test/workbook/worksheet/tc_worksheet_hyperlink.rb @@ -22,7 +22,6 @@ class TestWorksheetHyperlink < Test::Unit::TestCase end def test_target - assert_equal(@options[:target], Axlsx.instance_values_for(@a)['target']) end |
