diff options
| author | Zsolt Kozaroczy <[email protected]> | 2023-05-31 09:10:37 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-05-31 09:10:37 +0200 |
| commit | 810c0569a30e6bc053189ea56b4e4d70fd035ac2 (patch) | |
| tree | a6a8cf23fe994b50a78f0c8e17724e5836f91c73 /test | |
| parent | ede5a1c34e522846e01580c84a0b0d8b85330ed2 (diff) | |
| parent | 2a70161abe24ae130041aaca3eec79e63d08a5f5 (diff) | |
| download | caxlsx-810c0569a30e6bc053189ea56b4e4d70fd035ac2.tar.gz caxlsx-810c0569a30e6bc053189ea56b4e4d70fd035ac2.zip | |
Merge pull request #261 from tagliala/chore/fix-string-concatenation-in-non-production-code
Fix StringConcatenation offenses (non-production)
Diffstat (limited to 'test')
| -rw-r--r-- | test/doc_props/tc_app.rb | 2 | ||||
| -rw-r--r-- | test/doc_props/tc_core.rb | 2 | ||||
| -rw-r--r-- | test/drawing/tc_drawing.rb | 4 | ||||
| -rw-r--r-- | test/drawing/tc_hyperlink.rb | 2 | ||||
| -rw-r--r-- | test/drawing/tc_one_cell_anchor.rb | 2 | ||||
| -rw-r--r-- | test/drawing/tc_pic.rb | 8 | ||||
| -rw-r--r-- | test/util/tc_mime_type_utils.rb | 2 | ||||
| -rw-r--r-- | test/workbook/tc_shared_strings_table.rb | 2 | ||||
| -rw-r--r-- | test/workbook/worksheet/tc_rich_text_run.rb | 2 |
9 files changed, 13 insertions, 13 deletions
diff --git a/test/doc_props/tc_app.rb b/test/doc_props/tc_app.rb index 82e33f12..c066373c 100644 --- a/test/doc_props/tc_app.rb +++ b/test/doc_props/tc_app.rb @@ -41,6 +41,6 @@ class TestApp < Test::Unit::TestCase errors << error end - assert_equal(0, errors.size, "app.xml invalid" + errors.map(&:message).to_s) + assert_equal(0, errors.size, "app.xml invalid#{errors.map(&:message)}") end end diff --git a/test/doc_props/tc_core.rb b/test/doc_props/tc_core.rb index bfacab45..5a04a615 100644 --- a/test/doc_props/tc_core.rb +++ b/test/doc_props/tc_core.rb @@ -18,7 +18,7 @@ class TestCore < Test::Unit::TestCase errors << error end - assert_equal(0, errors.size, "core.xml Invalid" + errors.map(&:message).to_s) + assert_equal(0, errors.size, "core.xml Invalid#{errors.map(&:message)}") end def test_populates_created diff --git a/test/drawing/tc_drawing.rb b/test/drawing/tc_drawing.rb index d7e3e8df..d48ae604 100644 --- a/test/drawing/tc_drawing.rb +++ b/test/drawing/tc_drawing.rb @@ -26,7 +26,7 @@ class TestDrawing < Test::Unit::TestCase end def test_add_image - src = File.dirname(__FILE__) + "/../fixtures/image1.jpeg" + src = "#{File.dirname(__FILE__)}/../fixtures/image1.jpeg" image = @ws.add_image(image_src: src, start_at: [0, 0], width: 600, height: 400) assert(@ws.drawing.anchors.last.is_a?(Axlsx::OneCellAnchor)) @@ -36,7 +36,7 @@ class TestDrawing < Test::Unit::TestCase end def test_add_two_cell_anchor_image - src = File.dirname(__FILE__) + "/../fixtures/image1.jpeg" + 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)) diff --git a/test/drawing/tc_hyperlink.rb b/test/drawing/tc_hyperlink.rb index c3cffb1c..5a1f5d48 100644 --- a/test/drawing/tc_hyperlink.rb +++ b/test/drawing/tc_hyperlink.rb @@ -6,7 +6,7 @@ class TestHyperlink < Test::Unit::TestCase def setup @p = Axlsx::Package.new ws = @p.workbook.add_worksheet - @test_img = File.dirname(__FILE__) + "/../fixtures/image1.jpeg" + @test_img = "#{File.dirname(__FILE__)}/../fixtures/image1.jpeg" @image = ws.add_image image_src: @test_img, hyperlink: "http://axlsx.blogspot.com" @hyperlink = @image.hyperlink end diff --git a/test/drawing/tc_one_cell_anchor.rb b/test/drawing/tc_one_cell_anchor.rb index e3eb8d90..5015d123 100644 --- a/test/drawing/tc_one_cell_anchor.rb +++ b/test/drawing/tc_one_cell_anchor.rb @@ -6,7 +6,7 @@ class TestOneCellAnchor < Test::Unit::TestCase def setup @p = Axlsx::Package.new @ws = @p.workbook.add_worksheet - @test_img = File.dirname(__FILE__) + "/../fixtures/image1.jpeg" + @test_img = "#{File.dirname(__FILE__)}/../fixtures/image1.jpeg" @image = @ws.add_image image_src: @test_img @anchor = @image.anchor end diff --git a/test/drawing/tc_pic.rb b/test/drawing/tc_pic.rb index dc0f32da..f4961d4c 100644 --- a/test/drawing/tc_pic.rb +++ b/test/drawing/tc_pic.rb @@ -9,10 +9,10 @@ class TestPic < Test::Unit::TestCase @p = Axlsx::Package.new ws = @p.workbook.add_worksheet - @test_img = @test_img_jpg = File.dirname(__FILE__) + "/../fixtures/image1.jpeg" - @test_img_png = File.dirname(__FILE__) + "/../fixtures/image1.png" - @test_img_gif = File.dirname(__FILE__) + "/../fixtures/image1.gif" - @test_img_fake = File.dirname(__FILE__) + "/../fixtures/image1_fake.jpg" + @test_img = @test_img_jpg = "#{File.dirname(__FILE__)}/../fixtures/image1.jpeg" + @test_img_png = "#{File.dirname(__FILE__)}/../fixtures/image1.png" + @test_img_gif = "#{File.dirname(__FILE__)}/../fixtures/image1.gif" + @test_img_fake = "#{File.dirname(__FILE__)}/../fixtures/image1_fake.jpg" @test_img_remote_png = "https://example.com/sample-image.png" @test_img_remote_fake = "invalid_URI" @image = ws.add_image image_src: @test_img, hyperlink: 'https://github.com/randym', tooltip: "What's up doc?", opacity: 5 diff --git a/test/util/tc_mime_type_utils.rb b/test/util/tc_mime_type_utils.rb index fc7d9d79..16ba45cd 100644 --- a/test/util/tc_mime_type_utils.rb +++ b/test/util/tc_mime_type_utils.rb @@ -7,7 +7,7 @@ class TestMimeTypeUtils < Test::Unit::TestCase stub_request(:get, 'https://example.com/sample-image.png') .to_return(body: File.new('examples/sample.png'), status: 200) - @test_img = File.dirname(__FILE__) + "/../fixtures/image1.jpeg" + @test_img = "#{File.dirname(__FILE__)}/../fixtures/image1.jpeg" @test_img_url = "https://example.com/sample-image.png" end 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 |
