Sha256: 0d72798d10101bb74c5d6ddcf7b8554c53a369a30ea406dc9ec777fd569d3527

Contents?: true

Size: 645 Bytes

Versions: 19

Compression:

Stored size: 645 Bytes

Contents

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

Version data entries

19 entries across 19 versions & 6 rubygems

Version Path
caxlsx-3.1.1 test/drawing/tc_graphic_frame.rb
caxlsx-3.1.0 test/drawing/tc_graphic_frame.rb
bonio-axlsx-2.2.3 test/drawing/tc_graphic_frame.rb
caxlsx-3.0.4 test/drawing/tc_graphic_frame.rb
caxlsx-3.0.3 test/drawing/tc_graphic_frame.rb
caxlsx-3.0.2 test/drawing/tc_graphic_frame.rb
caxlsx-2.0.2 test/drawing/tc_graphic_frame.rb
caxlsx-3.0.1 test/drawing/tc_graphic_frame.rb
caxlsx-3.0.0 test/drawing/tc_graphic_frame.rb
axlsx-alt-3.0.1 test/drawing/tc_graphic_frame.rb
axlsx-alt-3.0.0 test/drawing/tc_graphic_frame.rb
axlsx-3.0.0.pre test/drawing/tc_graphic_frame.rb
bonio-axlsx-2.2.2 test/drawing/tc_graphic_frame.rb
bonio-axlsx-2.2.1 test/drawing/tc_graphic_frame.rb
dg-axlsx-2.1.0 test/drawing/tc_graphic_frame.rb
axlsx-2.1.0.pre test/drawing/tc_graphic_frame.rb
l_axlsx-2.0.1 test/drawing/tc_graphic_frame.rb
axlsx-2.0.1 test/drawing/tc_graphic_frame.rb
axlsx-2.0.0 test/drawing/tc_graphic_frame.rb