summaryrefslogtreecommitdiffhomepage
path: root/test/drawing/tc_pic.rb
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2013-08-17 13:51:53 +0900
committerRandy Morgan <[email protected]>2013-08-17 13:51:53 +0900
commit7b6a28906a5d19696cd3fcbc35759ccb157dc6df (patch)
tree1c47bab700f96633e5d1cab5fa7ffa1ce16ed065 /test/drawing/tc_pic.rb
parent3411a6d22a228e7170e4058d1d1715ef507ccffb (diff)
downloadcaxlsx-7b6a28906a5d19696cd3fcbc35759ccb157dc6df.tar.gz
caxlsx-7b6a28906a5d19696cd3fcbc35759ccb157dc6df.zip
updated image source validation to use lower case comparison of accepted file extensions
Diffstat (limited to 'test/drawing/tc_pic.rb')
-rw-r--r--test/drawing/tc_pic.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/drawing/tc_pic.rb b/test/drawing/tc_pic.rb
index 79a3194d..af8f6f57 100644
--- a/test/drawing/tc_pic.rb
+++ b/test/drawing/tc_pic.rb
@@ -21,21 +21,21 @@ class TestPic < Test::Unit::TestCase
def test_anchor_swapping
#swap from one cell to two cell when end_at is specified
assert(@image.anchor.is_a?(Axlsx::OneCellAnchor))
- start_at = @image.anchor.from
+ start_at = @image.anchor.from
@image.end_at 10,5
assert(@image.anchor.is_a?(Axlsx::TwoCellAnchor))
assert_equal(start_at.col, @image.anchor.from.col)
assert_equal(start_at.row, @image.anchor.from.row)
assert_equal(10,@image.anchor.to.col)
assert_equal(5, @image.anchor.to.row)
-
+
#swap from two cell to one cell when width or height are specified
@image.width = 200
assert(@image.anchor.is_a?(Axlsx::OneCellAnchor))
assert_equal(start_at.col, @image.anchor.from.col)
assert_equal(start_at.row, @image.anchor.from.row)
assert_equal(200, @image.width)
-
+
end
def test_hyperlink
assert_equal(@image.hyperlink.href, "https://github.com/randym")
@@ -76,6 +76,10 @@ class TestPic < Test::Unit::TestCase
assert_equal(@image.image_src, @test_img)
end
+ def test_image_src_downcase
+ assert_nothing_raised { @image.image_src = @test_img.upcase }
+ end
+
def test_descr
assert_raise(ArgumentError) { @image.descr = 49 }
assert_nothing_raised { @image.descr = "test" }
@@ -98,5 +102,5 @@ class TestPic < Test::Unit::TestCase
doc = Nokogiri::XML(@image.anchor.drawing.to_xml_string)
assert_equal r_id, doc.xpath("//a:blip").first["r:embed"]
end
-
+
end