From fa35f57cb658cb174fa80332bbe808a0e7374d96 Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Sat, 9 Jun 2012 10:39:01 +0900 Subject: specs for cell and text title parsing patch --- test/drawing/tc_title.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test') diff --git a/test/drawing/tc_title.rb b/test/drawing/tc_title.rb index e53c260a..e5386d43 100644 --- a/test/drawing/tc_title.rb +++ b/test/drawing/tc_title.rb @@ -1,3 +1,5 @@ +$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../" + require 'tc_helper.rb' class TestTitle < Test::Unit::TestCase @@ -30,4 +32,20 @@ class TestTitle < Test::Unit::TestCase assert(@title.text == "one") end + def test_to_xml_string_text + @title.text = 'foo' + doc = Nokogiri::XML(@title.to_xml_string) + assert_equal(1, doc.xpath('//rich').size) + assert_equal(1, doc.xpath('//t[text()="foo"]').size) + end + + def test_to_xml_string_cell + @title.cell = @row.cells.first + doc = Nokogiri::XML(@title.to_xml_string) + puts doc.to_xml + assert_equal(1, doc.xpath('//strCache').size) + assert_equal(1, doc.xpath('//v[text()="one"]').size) + end + + end -- cgit v1.2.3