blob: fa939f56d6bcc5db0ce6f642764e9397d497d964 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# frozen_string_literal: true
require 'tc_helper'
class TestVmlDrawing < Test::Unit::TestCase
def setup
p = Axlsx::Package.new
wb = p.workbook
@ws = wb.add_worksheet
@ws.add_comment ref: 'A1', text: 'penut machine', author: 'crank'
@ws.add_comment ref: 'C3', text: 'rust bucket', author: 'PO'
@vml_drawing = @ws.comments.vml_drawing
end
def test_initialize
assert_raise(ArgumentError) { Axlsx::VmlDrawing.new }
end
def test_to_xml_string
str = @vml_drawing.to_xml_string
doc = Nokogiri::XML(str)
assert_equal(2, doc.xpath("//v:shape").size)
assert(doc.xpath("//o:idmap[@o:data='#{@ws.index + 1}']"))
end
end
|