diff options
| author | Randy Morgan <[email protected]> | 2012-05-15 11:23:59 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-05-15 11:23:59 +0900 |
| commit | 2d744ba77906d460b608859c945a5741ec725e42 (patch) | |
| tree | 0366b619ea15909d230a2fa485a95d395486d6cf /test/drawing/tc_axis.rb | |
| parent | 2e1e14dd8f91e8a1416faae9501fdf04638104c7 (diff) | |
| download | caxlsx-2d744ba77906d460b608859c945a5741ec725e42.tar.gz caxlsx-2d744ba77906d460b608859c945a5741ec725e42.zip | |
bring coverage up to 100% and patch a few minor bugs in cell style overrides and misnamed app attributes.
Diffstat (limited to 'test/drawing/tc_axis.rb')
| -rw-r--r-- | test/drawing/tc_axis.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/drawing/tc_axis.rb b/test/drawing/tc_axis.rb index 7fe01395..c86d3c50 100644 --- a/test/drawing/tc_axis.rb +++ b/test/drawing/tc_axis.rb @@ -2,7 +2,7 @@ require 'tc_helper.rb' class TestAxis < Test::Unit::TestCase def setup - @axis = Axlsx::Axis.new 12345, 54321 + @axis = Axlsx::Axis.new 12345, 54321, :gridlines => false end def teardown end @@ -48,5 +48,15 @@ class TestAxis < Test::Unit::TestCase assert_raise(ArgumentError, "requires valid gridlines") { @axis.gridlines = 'alice' } assert_nothing_raised("accepts valid crosses") { @axis.gridlines = false } end + + def test_to_xml_string + str = '<?xml version="1.0" encoding="UTF-8"?>' + str << '<c:chartSpace xmlns:c="' << Axlsx::XML_NS_C << '" xmlns:a="' << Axlsx::XML_NS_A << '">' + doc = Nokogiri::XML(@axis.to_xml_string(str)) + assert(doc.xpath('//a:noFill')) + assert(doc.xpath("//c:crosses[@val='#{@crosses.to_s}']")) + assert(doc.xpath("//c:crossAx[@val='#{@crossAx.to_s}']")) + assert(doc.xpath("//a:bodyPr[@rot='#{@label_rotation.to_s}']")) + end end |
