blob: 30479f0f960da99f3264eb343372eef7a81c5f60 (
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
27
|
require 'tc_helper.rb'
class TestGraphicFrame < Test::Unit::TestCase
def setup
p = Axlsx::Package.new
@ws = p.workbook.add_worksheet
@chart = @ws.add_chart Axlsx::Chart
@frame = @chart.graphic_frame
end
def teardown; end
def test_initialization
assert(@frame.anchor.is_a?(Axlsx::TwoCellAnchor))
assert_equal(@frame.chart, @chart)
end
def test_rId
assert_equal @ws.drawing.relationships.for(@chart).Id, @frame.rId
end
def test_to_xml_has_correct_rId
doc = Nokogiri::XML(@frame.to_xml_string)
assert_equal @frame.rId, doc.xpath("//c:chart", doc.collect_namespaces).first["r:id"]
end
end
|