diff options
| author | Geremia Taglialatela <[email protected]> | 2023-04-10 12:13:09 +0200 |
|---|---|---|
| committer | Geremia Taglialatela <[email protected]> | 2023-04-10 12:13:09 +0200 |
| commit | a7532517c74ba3589279aa92042ca9da2336a5ea (patch) | |
| tree | 06962b0ba4e49e2182b43766e1859d14280f0cc9 /test/workbook | |
| parent | 84a2b255d6fd780f526ac3d9bf99a40f08792986 (diff) | |
| download | caxlsx-a7532517c74ba3589279aa92042ca9da2336a5ea.tar.gz caxlsx-a7532517c74ba3589279aa92042ca9da2336a5ea.zip | |
Fix some Layout/HashAlignment offenses
Some offenses have been selected and fixed automatically
Diffstat (limited to 'test/workbook')
| -rw-r--r-- | test/workbook/tc_workbook_view.rb | 4 | ||||
| -rw-r--r-- | test/workbook/worksheet/tc_conditional_formatting.rb | 26 | ||||
| -rw-r--r-- | test/workbook/worksheet/tc_data_validation.rb | 30 | ||||
| -rw-r--r-- | test/workbook/worksheet/tc_sheet_view.rb | 4 | ||||
| -rw-r--r-- | test/workbook/worksheet/tc_table_style_info.rb | 8 |
5 files changed, 36 insertions, 36 deletions
diff --git a/test/workbook/tc_workbook_view.rb b/test/workbook/tc_workbook_view.rb index 6fb300a8..8829924f 100644 --- a/test/workbook/tc_workbook_view.rb +++ b/test/workbook/tc_workbook_view.rb @@ -3,8 +3,8 @@ require 'tc_helper' class TestWorkbookView < Test::Unit::TestCase def setup @options = { visibility: :hidden, minimized: true, show_horizontal_scroll: true, show_vertical_scroll: true, - show_sheet_tabs: true, tab_ratio: 750, first_sheet: 0, active_tab: 1, x_window: 500, y_window: 400, - window_width: 800, window_height: 600, auto_filter_date_grouping: true } + show_sheet_tabs: true, tab_ratio: 750, first_sheet: 0, active_tab: 1, x_window: 500, y_window: 400, + window_width: 800, window_height: 600, auto_filter_date_grouping: true } @book_view = Axlsx::WorkbookView.new @options end diff --git a/test/workbook/worksheet/tc_conditional_formatting.rb b/test/workbook/worksheet/tc_conditional_formatting.rb index 2c8292ee..e6fc6324 100644 --- a/test/workbook/worksheet/tc_conditional_formatting.rb +++ b/test/workbook/worksheet/tc_conditional_formatting.rb @@ -26,11 +26,11 @@ class TestConditionalFormatting < Test::Unit::TestCase data_bar = Axlsx::DataBar.new :color => "FFFF0000" icon_set = Axlsx::IconSet.new :iconSet => "5Rating" cfr = Axlsx::ConditionalFormattingRule.new({ :type => :containsText, :text => "TRUE", - :dxfId => 0, :priority => 1, - :formula => 'NOT(ISERROR(SEARCH("FALSE",AB1)))', - :color_scale => color_scale, - :data_bar => data_bar, - :icon_set => icon_set }) + :dxfId => 0, :priority => 1, + :formula => 'NOT(ISERROR(SEARCH("FALSE",AB1)))', + :color_scale => color_scale, + :data_bar => data_bar, + :icon_set => icon_set }) assert(cfr.data_bar.is_a?(Axlsx::DataBar)) assert(cfr.icon_set.is_a?(Axlsx::IconSet)) @@ -69,11 +69,11 @@ class TestConditionalFormatting < Test::Unit::TestCase icon_set = Axlsx::IconSet.new :iconSet => "5Rating" cfs = @ws.add_conditional_formatting("B2:B2", [{ :type => :containsText, :text => "TRUE", - :dxfId => 0, :priority => 1, - :formula => 'NOT(ISERROR(SEARCH("FALSE",AB1)))', - :color_scale => color_scale, - :data_bar => data_bar, - :icon_set => icon_set }]) + :dxfId => 0, :priority => 1, + :formula => 'NOT(ISERROR(SEARCH("FALSE",AB1)))', + :color_scale => color_scale, + :data_bar => data_bar, + :icon_set => icon_set }]) doc = Nokogiri::XML.parse(cfs.last.to_xml_string) assert_equal(1, doc.xpath(".//conditionalFormatting[@sqref='B2:B2']//cfRule[@type='containsText'][@dxfId=0][@priority=1]").size) assert doc.xpath(".//conditionalFormatting//cfRule[@type='containsText'][@dxfId=0][@priority=1]//formula='NOT(ISERROR(SEARCH(\"FALSE\",AB1)))'") @@ -104,9 +104,9 @@ class TestConditionalFormatting < Test::Unit::TestCase def test_many_options cf = Axlsx::ConditionalFormatting.new(:sqref => "B3:B4") cf.add_rule({ :type => :cellIs, :aboveAverage => false, :bottom => false, :dxfId => 0, - :equalAverage => false, :priority => 2, :operator => :lessThan, :text => "", - :percent => false, :rank => 0, :stdDev => 1, :stopIfTrue => true, :timePeriod => :today, - :formula => "0.0" }) + :equalAverage => false, :priority => 2, :operator => :lessThan, :text => "", + :percent => false, :rank => 0, :stdDev => 1, :stopIfTrue => true, :timePeriod => :today, + :formula => "0.0" }) doc = Nokogiri::XML.parse(cf.to_xml_string) assert_equal(1, doc.xpath(".//conditionalFormatting//cfRule[@type='cellIs'][@aboveAverage=0][@bottom=0][@dxfId=0][@equalAverage=0][@priority=2][@operator='lessThan'][@text=''][@percent=0][@rank=0][@stdDev=1][@stopIfTrue=1][@timePeriod='today']").size) assert doc.xpath(".//conditionalFormatting//cfRule[@type='cellIs'][@aboveAverage=0][@bottom=0][@dxfId=0][@equalAverage=0][@priority=2][@operator='lessThan'][@text=''][@percent=0][@rank=0][@stdDev=1][@stopIfTrue=1][@timePeriod='today']//formula=0.0") diff --git a/test/workbook/worksheet/tc_data_validation.rb b/test/workbook/worksheet/tc_data_validation.rb index 3dffee39..ff92b847 100644 --- a/test/workbook/worksheet/tc_data_validation.rb +++ b/test/workbook/worksheet/tc_data_validation.rb @@ -165,9 +165,9 @@ class TestDataValidation < Test::Unit::TestCase p = Axlsx::Package.new @ws = p.workbook.add_worksheet :name => "data_validation" @ws.add_data_validation("A1", { :type => :whole, :operator => :between, :formula1 => '5', :formula2 => '10', - :showErrorMessage => true, :errorTitle => 'Wrong input', :error => 'Only values between 5 and 10', - :errorStyle => :information, :showInputMessage => true, :promptTitle => 'Be carful!', - :prompt => 'Only values between 5 and 10' }) + :showErrorMessage => true, :errorTitle => 'Wrong input', :error => 'Only values between 5 and 10', + :errorStyle => :information, :showInputMessage => true, :promptTitle => 'Be carful!', + :prompt => 'Only values between 5 and 10' }) doc = Nokogiri::XML.parse(@ws.to_xml_string) @@ -194,9 +194,9 @@ class TestDataValidation < Test::Unit::TestCase p = Axlsx::Package.new @ws = p.workbook.add_worksheet :name => "data_validation" @ws.add_data_validation("A1", { :type => :list, :formula1 => 'A1:A5', - :showErrorMessage => true, :errorTitle => 'Wrong input', :error => 'Only values from list', - :errorStyle => :stop, :showInputMessage => true, :promptTitle => 'Be carful!', - :prompt => 'Only values from list', :hideDropDown => true }) + :showErrorMessage => true, :errorTitle => 'Wrong input', :error => 'Only values from list', + :errorStyle => :stop, :showInputMessage => true, :promptTitle => 'Be carful!', + :prompt => 'Only values from list', :hideDropDown => true }) doc = Nokogiri::XML.parse(@ws.to_xml_string) @@ -218,9 +218,9 @@ class TestDataValidation < Test::Unit::TestCase p = Axlsx::Package.new @ws = p.workbook.add_worksheet :name => "data_validation" @ws.add_data_validation("A1", { :type => :custom, :formula1 => '=5/2', - :showErrorMessage => true, :errorTitle => 'Wrong input', :error => 'Only values corresponding formula', - :errorStyle => :stop, :showInputMessage => true, :promptTitle => 'Be carful!', - :prompt => 'Only values corresponding formula' }) + :showErrorMessage => true, :errorTitle => 'Wrong input', :error => 'Only values corresponding formula', + :errorStyle => :stop, :showInputMessage => true, :promptTitle => 'Be carful!', + :prompt => 'Only values corresponding formula' }) doc = Nokogiri::XML.parse(@ws.to_xml_string) @@ -241,13 +241,13 @@ class TestDataValidation < Test::Unit::TestCase p = Axlsx::Package.new @ws = p.workbook.add_worksheet :name => "data_validation" @ws.add_data_validation("A1", { :type => :whole, :operator => :between, :formula1 => '5', :formula2 => '10', - :showErrorMessage => true, :errorTitle => 'Wrong input', :error => 'Only values between 5 and 10', - :errorStyle => :information, :showInputMessage => true, :promptTitle => 'Be carful!', - :prompt => 'Only values between 5 and 10' }) + :showErrorMessage => true, :errorTitle => 'Wrong input', :error => 'Only values between 5 and 10', + :errorStyle => :information, :showInputMessage => true, :promptTitle => 'Be carful!', + :prompt => 'Only values between 5 and 10' }) @ws.add_data_validation("B1", { :type => :list, :formula1 => 'A1:A5', - :showErrorMessage => true, :errorTitle => 'Wrong input', :error => 'Only values from list', - :errorStyle => :stop, :showInputMessage => true, :promptTitle => 'Be carful!', - :prompt => 'Only values from list', :hideDropDown => true }) + :showErrorMessage => true, :errorTitle => 'Wrong input', :error => 'Only values from list', + :errorStyle => :stop, :showInputMessage => true, :promptTitle => 'Be carful!', + :prompt => 'Only values from list', :hideDropDown => true }) doc = Nokogiri::XML.parse(@ws.to_xml_string) diff --git a/test/workbook/worksheet/tc_sheet_view.rb b/test/workbook/worksheet/tc_sheet_view.rb index 03030d2c..0f0986cf 100644 --- a/test/workbook/worksheet/tc_sheet_view.rb +++ b/test/workbook/worksheet/tc_sheet_view.rb @@ -5,8 +5,8 @@ class TestSheetView < Test::Unit::TestCase def setup # inverse defaults for booleans @boolean_options = { :right_to_left => true, :show_formulas => true, :show_outline_symbols => true, - :show_white_space => true, :tab_selected => true, :default_grid_color => false, :show_grid_lines => false, - :show_row_col_headers => false, :show_ruler => false, :show_zeros => false, :window_protection => true } + :show_white_space => true, :tab_selected => true, :default_grid_color => false, :show_grid_lines => false, + :show_row_col_headers => false, :show_ruler => false, :show_zeros => false, :window_protection => true } @symbol_options = { :view => :page_break_preview } @nil_options = { :color_id => 2, :top_left_cell => 'A2' } @int_0 = { :zoom_scale_normal => 100, :zoom_scale_page_layout_view => 100, :zoom_scale_sheet_layout_view => 100, :workbook_view_id => 2 } diff --git a/test/workbook/worksheet/tc_table_style_info.rb b/test/workbook/worksheet/tc_table_style_info.rb index b56ac560..3d71dc9b 100644 --- a/test/workbook/worksheet/tc_table_style_info.rb +++ b/test/workbook/worksheet/tc_table_style_info.rb @@ -9,10 +9,10 @@ class TestTableStyleInfo < Test::Unit::TestCase end @table = @ws.add_table(Axlsx::cell_range([@ws.rows.first.cells.first, @ws.rows.last.cells.last], false), :name => 'foo') @options = { :show_first_column => 1, - :show_last_column => 1, - :show_row_stripes => 1, - :show_column_stripes => 1, - :name => "TableStyleDark4" } + :show_last_column => 1, + :show_row_stripes => 1, + :show_column_stripes => 1, + :name => "TableStyleDark4" } end def test_initialize |
