blob: ad12642ae3c6684d6967935afe0ebc881acf3c2f (
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
|
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
|