From b2c9fbca7564d80e7e82042f8ee0c8133bdb1f1c Mon Sep 17 00:00:00 2001 From: Luka Lüdicke Date: Thu, 26 Nov 2020 19:12:04 +0100 Subject: Group worksheet name tests together Opposes a redundant test --- test/workbook/worksheet/tc_worksheet.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/test/workbook/worksheet/tc_worksheet.rb b/test/workbook/worksheet/tc_worksheet.rb index 781f5250..24f5a7c7 100644 --- a/test/workbook/worksheet/tc_worksheet.rb +++ b/test/workbook/worksheet/tc_worksheet.rb @@ -29,17 +29,6 @@ class TestWorksheet < Test::Unit::TestCase assert_raises(ArgumentError) { @ws.name = 'foo?bar' } end - def test_exception_if_name_too_long - assert_nothing_raised { @ws.name = 'x' * 31 } - assert_raises(ArgumentError) { @ws.name = 'x' * 32 } - end - - def test_exception_if_name_too_long_because_of_multibyte_characters - three_byte_character = "✔" - assert_nothing_raised { @ws.name = 'x' * 28 + three_byte_character} - assert_raises(ArgumentError) { @ws.name = 'x' * 29 + three_byte_character } - end - def test_page_margins assert(@ws.page_margins.is_a? Axlsx::PageMargins) end @@ -475,6 +464,17 @@ class TestWorksheet < Test::Unit::TestCase assert_nothing_raised { @ws.name = Array.new(31, "A").join() } end + def test_exception_if_name_too_long + assert_nothing_raised { @ws.name = 'x' * 31 } + assert_raises(ArgumentError) { @ws.name = 'x' * 32 } + end + + def test_exception_if_name_too_long_because_of_multibyte_characters + three_byte_character = "✔" + assert_nothing_raised { @ws.name = 'x' * 28 + three_byte_character} + assert_raises(ArgumentError) { @ws.name = 'x' * 29 + three_byte_character } + end + def test_set_fixed_width_column @ws.add_row ["mule", "donkey", "horse"], :widths => [20, :ignore, nil] assert(@ws.column_info.size == 3, "a data item for each column") -- cgit v1.2.3