diff options
| author | Randy Morgan <[email protected]> | 2012-06-09 10:39:01 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-06-09 10:39:01 +0900 |
| commit | fa35f57cb658cb174fa80332bbe808a0e7374d96 (patch) | |
| tree | 68c2860594acf57874981531c94be86dd277dcbb /test | |
| parent | 3c9bca0d855f8d236fffba42a04aea2aae0be497 (diff) | |
| download | caxlsx-fa35f57cb658cb174fa80332bbe808a0e7374d96.tar.gz caxlsx-fa35f57cb658cb174fa80332bbe808a0e7374d96.zip | |
specs for cell and text title parsing patch
Diffstat (limited to 'test')
| -rw-r--r-- | test/drawing/tc_title.rb | 18 |
1 files changed, 18 insertions, 0 deletions
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 |
