summaryrefslogtreecommitdiffhomepage
path: root/test/drawing
diff options
context:
space:
mode:
authorZsolt Kozaroczy <[email protected]>2020-09-11 00:36:29 +0200
committerGitHub <[email protected]>2020-09-11 00:36:29 +0200
commit282eec44ef01746ee25931fa6cd287ad083fd40b (patch)
tree14504bf429ca264812679ca971c1592853d3f762 /test/drawing
parent317e8244e4d17c394c1e181f86df3974623fb865 (diff)
downloadcaxlsx-282eec44ef01746ee25931fa6cd287ad083fd40b.tar.gz
caxlsx-282eec44ef01746ee25931fa6cd287ad083fd40b.zip
Restructure examples folder (#47)
Split examples into separate markdown files, each containing a description, sample code, and a screenshot of the resulting xlsx document. The script `generate.rb` is provided to actually generate the example documents by executing the sample code contained in the markdown files.
Diffstat (limited to 'test/drawing')
-rw-r--r--test/drawing/tc_drawing.rb4
-rw-r--r--test/drawing/tc_hyperlink.rb2
-rw-r--r--test/drawing/tc_one_cell_anchor.rb2
-rw-r--r--test/drawing/tc_pic.rb8
4 files changed, 8 insertions, 8 deletions
diff --git a/test/drawing/tc_drawing.rb b/test/drawing/tc_drawing.rb
index c9095fe7..05ffee98 100644
--- a/test/drawing/tc_drawing.rb
+++ b/test/drawing/tc_drawing.rb
@@ -23,7 +23,7 @@ class TestDrawing < Test::Unit::TestCase
end
def test_add_image
- src = File.dirname(__FILE__) + "/../../examples/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))
assert(image.is_a?(Axlsx::Pic))
@@ -31,7 +31,7 @@ class TestDrawing < Test::Unit::TestCase
assert_equal(400, image.height)
end
def test_add_two_cell_anchor_image
- src = File.dirname(__FILE__) + "/../../examples/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))
assert(image.is_a?(Axlsx::Pic))
diff --git a/test/drawing/tc_hyperlink.rb b/test/drawing/tc_hyperlink.rb
index b3f204b5..3a95886a 100644
--- a/test/drawing/tc_hyperlink.rb
+++ b/test/drawing/tc_hyperlink.rb
@@ -5,7 +5,7 @@ class TestHyperlink < Test::Unit::TestCase
def setup
@p = Axlsx::Package.new
ws = @p.workbook.add_worksheet
- @test_img = File.dirname(__FILE__) + "/../../examples/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 cba66112..3c1db55f 100644
--- a/test/drawing/tc_one_cell_anchor.rb
+++ b/test/drawing/tc_one_cell_anchor.rb
@@ -5,7 +5,7 @@ class TestOneCellAnchor < Test::Unit::TestCase
def setup
@p = Axlsx::Package.new
@ws = @p.workbook.add_worksheet
- @test_img = File.dirname(__FILE__) + "/../../examples/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 67e6c416..8c2088d4 100644
--- a/test/drawing/tc_pic.rb
+++ b/test/drawing/tc_pic.rb
@@ -5,10 +5,10 @@ class TestPic < Test::Unit::TestCase
def setup
@p = Axlsx::Package.new
ws = @p.workbook.add_worksheet
- @test_img = @test_img_jpg = File.dirname(__FILE__) + "/../../examples/image1.jpeg"
- @test_img_png = File.dirname(__FILE__) + "/../../examples/image1.png"
- @test_img_gif = File.dirname(__FILE__) + "/../../examples/image1.gif"
- @test_img_fake = File.dirname(__FILE__) + "/../../examples/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"
@image = ws.add_image :image_src => @test_img, :hyperlink => 'https://github.com/randym', :tooltip => "What's up doc?", :opacity => 5
end