summaryrefslogtreecommitdiffhomepage
path: root/test/workbook
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-05-25 14:17:12 +0200
committerGeremia Taglialatela <[email protected]>2023-05-25 14:17:12 +0200
commit2a70161abe24ae130041aaca3eec79e63d08a5f5 (patch)
tree5dd5cbdfda525eaaaf857513dafc322096eeaf47 /test/workbook
parent14b7da239879d5299775c48666b43f3016add8ec (diff)
downloadcaxlsx-2a70161abe24ae130041aaca3eec79e63d08a5f5.tar.gz
caxlsx-2a70161abe24ae130041aaca3eec79e63d08a5f5.zip
Fix StringConcatenation offenses (non-production)
Prefer interpolation over concatenation ``` Comparison ("String#{'String'}" vs 'String' + 'String'): interpolation: 11821321.0 i/s concatenation: 8849491.7 i/s - 1.34x (± 0.00) slower ```
Diffstat (limited to 'test/workbook')
-rw-r--r--test/workbook/tc_shared_strings_table.rb2
-rw-r--r--test/workbook/worksheet/tc_rich_text_run.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/test/workbook/tc_shared_strings_table.rb b/test/workbook/tc_shared_strings_table.rb
index 2edf5f4a..4ac8b112 100644
--- a/test/workbook/tc_shared_strings_table.rb
+++ b/test/workbook/tc_shared_strings_table.rb
@@ -45,7 +45,7 @@ class TestSharedStringsTable < Test::Unit::TestCase
errors << error
end
- assert_equal(0, errors.size, "sharedStirngs.xml Invalid" + errors.map(&:message).to_s)
+ assert_equal(0, errors.size, "sharedStirngs.xml Invalid#{errors.map(&:message)}")
end
def test_remove_control_characters_in_xml_serialization
diff --git a/test/workbook/worksheet/tc_rich_text_run.rb b/test/workbook/worksheet/tc_rich_text_run.rb
index 6274dda8..be05d818 100644
--- a/test/workbook/worksheet/tc_rich_text_run.rb
+++ b/test/workbook/worksheet/tc_rich_text_run.rb
@@ -151,7 +151,7 @@ class RichTextRun < Test::Unit::TestCase
def test_multiline_autowidth
wrap = @p.workbook.styles.add_style({ alignment: { wrap_text: true } })
- awtr = Axlsx::RichTextRun.new('I\'m bold' + "\n", b: true)
+ awtr = Axlsx::RichTextRun.new("I'm bold\n", b: true)
rt = Axlsx::RichText.new
rt.runs << awtr
@ws.add_row [rt], style: wrap