summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-04-09 16:55:57 +0200
committerGeremia Taglialatela <[email protected]>2023-04-09 16:55:57 +0200
commitc77a48805c17d36c4503df8cf0fe75e7b620e2d4 (patch)
tree05f26df0b6d75846d0868d4bd6d4ad090ea1073c /test
parent3befab6f5713c537f6b90b51c02882273c7f7cc9 (diff)
downloadcaxlsx-c77a48805c17d36c4503df8cf0fe75e7b620e2d4.tar.gz
caxlsx-c77a48805c17d36c4503df8cf0fe75e7b620e2d4.zip
Fix offenses related to indentation consistency
Diffstat (limited to 'test')
-rw-r--r--test/drawing/tc_bar_3D_chart.rb10
-rw-r--r--test/drawing/tc_bar_chart.rb10
-rw-r--r--test/drawing/tc_d_lbls.rb16
-rw-r--r--test/drawing/tc_data_source.rb4
-rw-r--r--test/drawing/tc_drawing.rb4
-rw-r--r--test/drawing/tc_line_3d_chart.rb20
-rw-r--r--test/stylesheet/tc_table_style_element.rb2
-rw-r--r--test/util/tc_validators.rb8
-rw-r--r--test/workbook/worksheet/auto_filter/tc_filter_column.rb4
-rw-r--r--test/workbook/worksheet/tc_data_validation.rb4
-rw-r--r--test/workbook/worksheet/tc_outline_pr.rb24
-rw-r--r--test/workbook/worksheet/tc_page_set_up_pr.rb18
-rw-r--r--test/workbook/worksheet/tc_pane.rb2
-rw-r--r--test/workbook/worksheet/tc_protected_range.rb22
-rw-r--r--test/workbook/worksheet/tc_sheet_format_pr.rb24
-rw-r--r--test/workbook/worksheet/tc_sheet_view.rb4
-rw-r--r--test/workbook/worksheet/tc_table_style_info.rb4
-rw-r--r--test/workbook/worksheet/tc_worksheet.rb2
18 files changed, 91 insertions, 91 deletions
diff --git a/test/drawing/tc_bar_3D_chart.rb b/test/drawing/tc_bar_3D_chart.rb
index f7e15dea..3c22e191 100644
--- a/test/drawing/tc_bar_3D_chart.rb
+++ b/test/drawing/tc_bar_3D_chart.rb
@@ -25,11 +25,11 @@ class TestBar3DChart < Test::Unit::TestCase
assert(@chart.bar_dir == :col)
end
- def test_grouping
- assert_raise(ArgumentError, "require valid grouping") { @chart.grouping = :inverted }
- assert_nothing_raised("allow valid grouping") { @chart.grouping = :standard }
- assert(@chart.grouping == :standard)
- end
+ def test_grouping
+ assert_raise(ArgumentError, "require valid grouping") { @chart.grouping = :inverted }
+ assert_nothing_raised("allow valid grouping") { @chart.grouping = :standard }
+ assert(@chart.grouping == :standard)
+ end
def test_gap_width
assert_raise(ArgumentError, "require valid gap width") { @chart.gap_width = -1 }
diff --git a/test/drawing/tc_bar_chart.rb b/test/drawing/tc_bar_chart.rb
index 75a2970d..5106d266 100644
--- a/test/drawing/tc_bar_chart.rb
+++ b/test/drawing/tc_bar_chart.rb
@@ -25,11 +25,11 @@ class TestBarChart < Test::Unit::TestCase
assert(@chart.bar_dir == :col)
end
- def test_grouping
- assert_raise(ArgumentError, "require valid grouping") { @chart.grouping = :inverted }
- assert_nothing_raised("allow valid grouping") { @chart.grouping = :standard }
- assert(@chart.grouping == :standard)
- end
+ def test_grouping
+ assert_raise(ArgumentError, "require valid grouping") { @chart.grouping = :inverted }
+ assert_nothing_raised("allow valid grouping") { @chart.grouping = :standard }
+ assert(@chart.grouping == :standard)
+ end
def test_gap_width
assert_raise(ArgumentError, "require valid gap width") { @chart.gap_width = -1 }
diff --git a/test/drawing/tc_d_lbls.rb b/test/drawing/tc_d_lbls.rb
index cc96299d..a8647f9c 100644
--- a/test/drawing/tc_d_lbls.rb
+++ b/test/drawing/tc_d_lbls.rb
@@ -44,13 +44,13 @@ class TestDLbls < Test::Unit::TestCase
end
def test_to_xml_string
- str = '<?xml version="1.0" encoding="UTF-8"?>'
- str << '<c:chartSpace xmlns:c="' << Axlsx::XML_NS_C << '" xmlns:a="' << Axlsx::XML_NS_A << '" xmlns:r="' << Axlsx::XML_NS_R << '">'
- @d_lbls.to_xml_string(str)
- str << '</c:chartSpace>'
- doc = Nokogiri::XML(str)
- Axlsx.instance_values_for(@d_lbls).each do |name, value|
- assert(doc.xpath("//c:#{Axlsx::camel(name, false)}[@val='#{value}']"), "#{name} is properly serialized")
- end
+ str = '<?xml version="1.0" encoding="UTF-8"?>'
+ str << '<c:chartSpace xmlns:c="' << Axlsx::XML_NS_C << '" xmlns:a="' << Axlsx::XML_NS_A << '" xmlns:r="' << Axlsx::XML_NS_R << '">'
+ @d_lbls.to_xml_string(str)
+ str << '</c:chartSpace>'
+ doc = Nokogiri::XML(str)
+ Axlsx.instance_values_for(@d_lbls).each do |name, value|
+ assert(doc.xpath("//c:#{Axlsx::camel(name, false)}[@val='#{value}']"), "#{name} is properly serialized")
+ end
end
end
diff --git a/test/drawing/tc_data_source.rb b/test/drawing/tc_data_source.rb
index 2fec667f..b635d56e 100644
--- a/test/drawing/tc_data_source.rb
+++ b/test/drawing/tc_data_source.rb
@@ -1,6 +1,6 @@
require 'tc_helper.rb'
- class TestNumDataSource < Test::Unit::TestCase
+class TestNumDataSource < Test::Unit::TestCase
def setup
@data_source = Axlsx::NumDataSource.new :data => ["1", "2", "3"]
end
@@ -18,4 +18,4 @@ require 'tc_helper.rb'
doc = Nokogiri::XML(str)
assert_equal(doc.xpath("//c:val").size, 1)
end
- end
+end
diff --git a/test/drawing/tc_drawing.rb b/test/drawing/tc_drawing.rb
index c5fc98e1..282a03da 100644
--- a/test/drawing/tc_drawing.rb
+++ b/test/drawing/tc_drawing.rb
@@ -31,8 +31,8 @@ class TestDrawing < Test::Unit::TestCase
end
def test_add_two_cell_anchor_image
- src = File.dirname(__FILE__) + "/../fixtures/image1.jpeg"
- image = @ws.add_image(:image_src => src, :start_at => [0, 0], :end_at => [15, 0])
+ src = File.dirname(__FILE__) + "/../fixtures/image1.jpeg"
+ image = @ws.add_image(:image_src => src, :start_at => [0, 0], :end_at => [15, 0])
assert(@ws.drawing.anchors.last.is_a?(Axlsx::TwoCellAnchor))
assert(image.is_a?(Axlsx::Pic))
end
diff --git a/test/drawing/tc_line_3d_chart.rb b/test/drawing/tc_line_3d_chart.rb
index 55398d50..c91e9216 100644
--- a/test/drawing/tc_line_3d_chart.rb
+++ b/test/drawing/tc_line_3d_chart.rb
@@ -19,17 +19,17 @@ class TestLine3DChart < Test::Unit::TestCase
assert(@chart.serAxis.is_a?(Axlsx::SerAxis), "value access not created")
end
- def test_grouping
- assert_raise(ArgumentError, "require valid grouping") { @chart.grouping = :inverted }
- assert_nothing_raised("allow valid grouping") { @chart.grouping = :stacked }
- assert(@chart.grouping == :stacked)
- end
+ def test_grouping
+ assert_raise(ArgumentError, "require valid grouping") { @chart.grouping = :inverted }
+ assert_nothing_raised("allow valid grouping") { @chart.grouping = :stacked }
+ assert(@chart.grouping == :stacked)
+ end
- def test_gapDepth
- assert_raise(ArgumentError, "require valid gapDepth") { @chart.gapDepth = 200 }
- assert_nothing_raised("allow valid gapDepth") { @chart.gapDepth = "200%" }
- assert(@chart.gapDepth == "200%")
- end
+ def test_gapDepth
+ assert_raise(ArgumentError, "require valid gapDepth") { @chart.gapDepth = 200 }
+ assert_nothing_raised("allow valid gapDepth") { @chart.gapDepth = "200%" }
+ assert(@chart.gapDepth == "200%")
+ end
def test_to_xml
schema = Nokogiri::XML::Schema(File.open(Axlsx::DRAWING_XSD))
diff --git a/test/stylesheet/tc_table_style_element.rb b/test/stylesheet/tc_table_style_element.rb
index 4af3aeb5..021d4fca 100644
--- a/test/stylesheet/tc_table_style_element.rb
+++ b/test/stylesheet/tc_table_style_element.rb
@@ -38,7 +38,7 @@ class TestTableStyleElement < Test::Unit::TestCase
def test_to_xml_string
doc = Nokogiri::XML(@item.to_xml_string)
- @item.type = :headerRow
+ @item.type = :headerRow
assert(doc.xpath("//tableStyleElement[@type='#{@item.type.to_s}']"))
end
end
diff --git a/test/util/tc_validators.rb b/test/util/tc_validators.rb
index c0e2e356..ba3edba6 100644
--- a/test/util/tc_validators.rb
+++ b/test/util/tc_validators.rb
@@ -204,9 +204,9 @@ class TestValidators < Test::Unit::TestCase
end
def test_range_validation
- # exclusive
- assert_raise(ArgumentError) { Axlsx::RangeValidator.validate('foo', 1, 10, 10, false) }
- # inclusive by default
- assert_nothing_raised { Axlsx::RangeValidator.validate('foo', 1, 10, 10) }
+ # exclusive
+ assert_raise(ArgumentError) { Axlsx::RangeValidator.validate('foo', 1, 10, 10, false) }
+ # inclusive by default
+ assert_nothing_raised { Axlsx::RangeValidator.validate('foo', 1, 10, 10) }
end
end
diff --git a/test/workbook/worksheet/auto_filter/tc_filter_column.rb b/test/workbook/worksheet/auto_filter/tc_filter_column.rb
index 642b7b6e..88f73e0d 100644
--- a/test/workbook/worksheet/auto_filter/tc_filter_column.rb
+++ b/test/workbook/worksheet/auto_filter/tc_filter_column.rb
@@ -56,9 +56,9 @@ class TestFilterColumn < Test::Unit::TestCase
def test_col_id=
assert_raise ArgumentError do
- @filter_column.col_id = :bar
+ @filter_column.col_id = :bar
end
- assert_nothing_raised { @filter_column.col_id = 7 }
+ assert_nothing_raised { @filter_column.col_id = 7 }
end
def test_to_xml_string
diff --git a/test/workbook/worksheet/tc_data_validation.rb b/test/workbook/worksheet/tc_data_validation.rb
index 59fd34f6..f93c91fe 100644
--- a/test/workbook/worksheet/tc_data_validation.rb
+++ b/test/workbook/worksheet/tc_data_validation.rb
@@ -272,7 +272,7 @@ class TestDataValidation < Test::Unit::TestCase
end
def test_empty_attributes
- v = Axlsx::DataValidation.new
- assert_equal(nil, v.send(:get_valid_attributes))
+ v = Axlsx::DataValidation.new
+ assert_equal(nil, v.send(:get_valid_attributes))
end
end
diff --git a/test/workbook/worksheet/tc_outline_pr.rb b/test/workbook/worksheet/tc_outline_pr.rb
index a40108b1..d2906a61 100644
--- a/test/workbook/worksheet/tc_outline_pr.rb
+++ b/test/workbook/worksheet/tc_outline_pr.rb
@@ -1,19 +1,19 @@
require 'tc_helper.rb'
class TestOutlinePr < Test::Unit::TestCase
- def setup
- @outline_pr = Axlsx::OutlinePr.new(:summary_below => false, :summary_right => true, :apply_styles => false)
- end
+ def setup
+ @outline_pr = Axlsx::OutlinePr.new(:summary_below => false, :summary_right => true, :apply_styles => false)
+ end
- def test_summary_below
- assert_equal false, @outline_pr.summary_below
- end
+ def test_summary_below
+ assert_equal false, @outline_pr.summary_below
+ end
- def test_summary_right
- assert_equal true, @outline_pr.summary_right
- end
+ def test_summary_right
+ assert_equal true, @outline_pr.summary_right
+ end
- def test_apply_styles
- assert_equal false, @outline_pr.apply_styles
- end
+ def test_apply_styles
+ assert_equal false, @outline_pr.apply_styles
+ end
end
diff --git a/test/workbook/worksheet/tc_page_set_up_pr.rb b/test/workbook/worksheet/tc_page_set_up_pr.rb
index d04097d0..8ca4f825 100644
--- a/test/workbook/worksheet/tc_page_set_up_pr.rb
+++ b/test/workbook/worksheet/tc_page_set_up_pr.rb
@@ -1,15 +1,15 @@
require 'tc_helper.rb'
class TestPageSetUpPr < Test::Unit::TestCase
- def setup
- @page_setup_pr = Axlsx::PageSetUpPr.new(:fit_to_page => true, :auto_page_breaks => true)
- end
+ def setup
+ @page_setup_pr = Axlsx::PageSetUpPr.new(:fit_to_page => true, :auto_page_breaks => true)
+ end
- def test_fit_to_page
- assert_equal true, @page_setup_pr.fit_to_page
- end
+ def test_fit_to_page
+ assert_equal true, @page_setup_pr.fit_to_page
+ end
- def test_auto_page_breaks
- assert_equal true, @page_setup_pr.auto_page_breaks
- end
+ def test_auto_page_breaks
+ assert_equal true, @page_setup_pr.auto_page_breaks
+ end
end
diff --git a/test/workbook/worksheet/tc_pane.rb b/test/workbook/worksheet/tc_pane.rb
index d5f05933..fef1eb63 100644
--- a/test/workbook/worksheet/tc_pane.rb
+++ b/test/workbook/worksheet/tc_pane.rb
@@ -6,7 +6,7 @@ class TestPane < Test::Unit::TestCase
#inverse defaults for booleans
@nil_options = { :active_pane => :bottom_left, :state => :frozen, :top_left_cell => 'A2' }
@int_0_options = { :x_split => 2, :y_split => 2 }
- @options = @nil_options.merge(@int_0_options)
+ @options = @nil_options.merge(@int_0_options)
@pane = Axlsx::Pane.new(@options)
end
diff --git a/test/workbook/worksheet/tc_protected_range.rb b/test/workbook/worksheet/tc_protected_range.rb
index 6d609097..906c6014 100644
--- a/test/workbook/worksheet/tc_protected_range.rb
+++ b/test/workbook/worksheet/tc_protected_range.rb
@@ -1,16 +1,16 @@
require 'tc_helper.rb'
class TestProtectedRange < Test::Unit::TestCase
-def setup
- @p = Axlsx::Package.new
- @ws = @p.workbook.add_worksheet { |sheet| sheet.add_row [1, 2, 3, 4, 5, 6, 7, 8, 9] }
-end
+ def setup
+ @p = Axlsx::Package.new
+ @ws = @p.workbook.add_worksheet { |sheet| sheet.add_row [1, 2, 3, 4, 5, 6, 7, 8, 9] }
+ end
-def test_initialize_options
- assert_nothing_raised { Axlsx::ProtectedRange.new(:sqref => 'A1:B1', :name => "only bob") }
-end
+ def test_initialize_options
+ assert_nothing_raised { Axlsx::ProtectedRange.new(:sqref => 'A1:B1', :name => "only bob") }
+ end
-def test_range
- r = @ws.protect_range('A1:B1')
- assert_equal('A1:B1', r.sqref)
-end
+ def test_range
+ r = @ws.protect_range('A1:B1')
+ assert_equal('A1:B1', r.sqref)
+ end
end
diff --git a/test/workbook/worksheet/tc_sheet_format_pr.rb b/test/workbook/worksheet/tc_sheet_format_pr.rb
index 48643bc6..1240da26 100644
--- a/test/workbook/worksheet/tc_sheet_format_pr.rb
+++ b/test/workbook/worksheet/tc_sheet_format_pr.rb
@@ -44,33 +44,33 @@ class TestSheetFormatPr < Test::Unit::TestCase
end
def test_default_row_height
- assert_raise(ArgumentError) { @sheet_format_pr.default_row_height = :foo }
- assert_nothing_raised { @sheet_format_pr.default_row_height = 1.0 }
+ assert_raise(ArgumentError) { @sheet_format_pr.default_row_height = :foo }
+ assert_nothing_raised { @sheet_format_pr.default_row_height = 1.0 }
end
def test_default_col_width
- assert_raise(ArgumentError) { @sheet_format_pr.default_col_width = :foo }
- assert_nothing_raised { @sheet_format_pr.default_col_width = 1.0 }
+ assert_raise(ArgumentError) { @sheet_format_pr.default_col_width = :foo }
+ assert_nothing_raised { @sheet_format_pr.default_col_width = 1.0 }
end
def test_custom_height
- assert_raise(ArgumentError) { @sheet_format_pr.custom_height = :foo }
- assert_nothing_raised { @sheet_format_pr.custom_height = true }
+ assert_raise(ArgumentError) { @sheet_format_pr.custom_height = :foo }
+ assert_nothing_raised { @sheet_format_pr.custom_height = true }
end
def test_zero_height
- assert_raise(ArgumentError) { @sheet_format_pr.zero_height = :foo }
- assert_nothing_raised { @sheet_format_pr.zero_height = true }
+ assert_raise(ArgumentError) { @sheet_format_pr.zero_height = :foo }
+ assert_nothing_raised { @sheet_format_pr.zero_height = true }
end
def test_thick_top
- assert_raise(ArgumentError) { @sheet_format_pr.thick_top = :foo }
- assert_nothing_raised { @sheet_format_pr.thick_top = true }
+ assert_raise(ArgumentError) { @sheet_format_pr.thick_top = :foo }
+ assert_nothing_raised { @sheet_format_pr.thick_top = true }
end
def test_thick_bottom
- assert_raise(ArgumentError) { @sheet_format_pr.thick_bottom = :foo }
- assert_nothing_raised { @sheet_format_pr.thick_bottom = true }
+ assert_raise(ArgumentError) { @sheet_format_pr.thick_bottom = :foo }
+ assert_nothing_raised { @sheet_format_pr.thick_bottom = true }
end
def test_to_xml_string
diff --git a/test/workbook/worksheet/tc_sheet_view.rb b/test/workbook/worksheet/tc_sheet_view.rb
index a09287aa..fb8367a8 100644
--- a/test/workbook/worksheet/tc_sheet_view.rb
+++ b/test/workbook/worksheet/tc_sheet_view.rb
@@ -205,7 +205,7 @@ class TestSheetView < Test::Unit::TestCase
end
def test_add_selection
- @sv.add_selection(:top_left, :active_cell => "A1")
- assert_equal('A1', @sv.selections[:top_left].active_cell)
+ @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_style_info.rb b/test/workbook/worksheet/tc_table_style_info.rb
index 2067959c..b56ac560 100644
--- a/test/workbook/worksheet/tc_table_style_info.rb
+++ b/test/workbook/worksheet/tc_table_style_info.rb
@@ -25,8 +25,8 @@ class TestTableStyleInfo < Test::Unit::TestCase
def test_boolean_properties
table_style = Axlsx::TableStyleInfo.new
@options.keys.each do |key|
- assert_nothing_raised { table_style.send("#{key.to_sym}=", true) }
- assert_raises(ArgumentError) { table_style.send(key.to_sym, 'foo') }
+ assert_nothing_raised { table_style.send("#{key.to_sym}=", true) }
+ assert_raises(ArgumentError) { table_style.send(key.to_sym, 'foo') }
end
end
diff --git a/test/workbook/worksheet/tc_worksheet.rb b/test/workbook/worksheet/tc_worksheet.rb
index bae9f904..6c8e0781 100644
--- a/test/workbook/worksheet/tc_worksheet.rb
+++ b/test/workbook/worksheet/tc_worksheet.rb
@@ -348,7 +348,7 @@ class TestWorksheet < Test::Unit::TestCase
end
def test_to_xml_string_row_breaks
- @ws.add_page_break("A1")
+ @ws.add_page_break("A1")
doc = Nokogiri::XML(@ws.to_xml_string)
assert_equal(doc.xpath('//xmlns:worksheet/xmlns:rowBreaks/xmlns:brk[@id="0"]').size, 1)
end