Skip to content

Commit

Permalink
Test case to check sheet name is intact after serialized to xml
Browse files Browse the repository at this point in the history
  • Loading branch information
sato-s committed Nov 14, 2016
1 parent fe80334 commit 5a7e890
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/workbook/tc_workbook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,10 @@ def test_to_xml_uses_correct_rIds_for_pivotCache
doc = Nokogiri::XML(@wb.to_xml_string)
assert_equal pivot_table.cache_definition.rId, doc.xpath("//xmlns:pivotCache").first["r:id"]
end

def test_worksheet_name_is_intact_after_serialized_into_xml
sheet = @wb.add_worksheet(:name => '_Example')
wb_xml = Nokogiri::XML(@wb.to_xml_string)
assert_equal sheet.name, wb_xml.xpath('//xmlns:workbook/xmlns:sheets/*[1]/@name').to_s
end
end

0 comments on commit 5a7e890

Please sign in to comment.