summaryrefslogtreecommitdiffhomepage
path: root/test/workbook/worksheet/tc_print_options.rb
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-04-13 13:13:34 +0200
committerGeremia Taglialatela <[email protected]>2023-05-03 16:05:17 +0200
commit350f7ae9a04f3d39c099cc54f7c04bf31f385d96 (patch)
treee84af2a70d3b18a0b94c784338faf48215c9c8a8 /test/workbook/worksheet/tc_print_options.rb
parente81036b76e734ab03fac31faafb9732f6b3b2928 (diff)
downloadcaxlsx-350f7ae9a04f3d39c099cc54f7c04bf31f385d96.tar.gz
caxlsx-350f7ae9a04f3d39c099cc54f7c04bf31f385d96.zip
Add RuboCop Minitest
Diffstat (limited to 'test/workbook/worksheet/tc_print_options.rb')
-rw-r--r--test/workbook/worksheet/tc_print_options.rb44
1 files changed, 24 insertions, 20 deletions
diff --git a/test/workbook/worksheet/tc_print_options.rb b/test/workbook/worksheet/tc_print_options.rb
index 8dc2b804..40812b3e 100644
--- a/test/workbook/worksheet/tc_print_options.rb
+++ b/test/workbook/worksheet/tc_print_options.rb
@@ -8,63 +8,67 @@ class TestPrintOptions < Test::Unit::TestCase
end
def test_initialize
- assert_equal(false, @po.grid_lines)
- assert_equal(false, @po.headings)
- assert_equal(false, @po.horizontal_centered)
- assert_equal(false, @po.vertical_centered)
+ refute(@po.grid_lines)
+ refute(@po.headings)
+ refute(@po.horizontal_centered)
+ refute(@po.vertical_centered)
end
def test_initialize_with_options
optioned = Axlsx::PrintOptions.new(:grid_lines => true, :headings => true, :horizontal_centered => true, :vertical_centered => true)
- assert_equal(true, optioned.grid_lines)
- assert_equal(true, optioned.headings)
- assert_equal(true, optioned.horizontal_centered)
- assert_equal(true, optioned.vertical_centered)
+
+ assert(optioned.grid_lines)
+ assert(optioned.headings)
+ assert(optioned.horizontal_centered)
+ assert(optioned.vertical_centered)
end
def test_set_all_values
@po.set(:grid_lines => true, :headings => true, :horizontal_centered => true, :vertical_centered => true)
- assert_equal(true, @po.grid_lines)
- assert_equal(true, @po.headings)
- assert_equal(true, @po.horizontal_centered)
- assert_equal(true, @po.vertical_centered)
+
+ assert(@po.grid_lines)
+ assert(@po.headings)
+ assert(@po.horizontal_centered)
+ assert(@po.vertical_centered)
end
def test_set_some_values
@po.set(:grid_lines => true, :headings => true)
- assert_equal(true, @po.grid_lines)
- assert_equal(true, @po.headings)
- assert_equal(false, @po.horizontal_centered)
- assert_equal(false, @po.vertical_centered)
+
+ assert(@po.grid_lines)
+ assert(@po.headings)
+ refute(@po.horizontal_centered)
+ refute(@po.vertical_centered)
end
def test_to_xml
@po.set(:grid_lines => true, :headings => true, :horizontal_centered => true, :vertical_centered => true)
doc = Nokogiri::XML.parse(@po.to_xml_string)
+
assert_equal(1, doc.xpath(".//printOptions[@gridLines=1][@headings=1][@horizontalCentered=1][@verticalCentered=1]").size)
end
def test_grid_lines
assert_raise(ArgumentError) { @po.grid_lines = 99 }
assert_nothing_raised { @po.grid_lines = true }
- assert_equal(@po.grid_lines, true)
+ assert(@po.grid_lines)
end
def test_headings
assert_raise(ArgumentError) { @po.headings = 99 }
assert_nothing_raised { @po.headings = true }
- assert_equal(@po.headings, true)
+ assert(@po.headings)
end
def test_horizontal_centered
assert_raise(ArgumentError) { @po.horizontal_centered = 99 }
assert_nothing_raised { @po.horizontal_centered = true }
- assert_equal(@po.horizontal_centered, true)
+ assert(@po.horizontal_centered)
end
def test_vertical_centered
assert_raise(ArgumentError) { @po.vertical_centered = 99 }
assert_nothing_raised { @po.vertical_centered = true }
- assert_equal(@po.vertical_centered, true)
+ assert(@po.vertical_centered)
end
end