summaryrefslogtreecommitdiffhomepage
path: root/test/drawing/tc_axes.rb
diff options
context:
space:
mode:
authorMoses Hohman <[email protected]>2013-06-23 01:06:26 -0500
committerMoses Hohman <[email protected]>2013-06-23 01:06:26 -0500
commit173f1c49fb449aebc5ddf30a9387006ee54e5260 (patch)
tree15262ded1d8fe4a6d4ce814423e22ccf0c3fa6e5 /test/drawing/tc_axes.rb
parent21fce3b99e639abe757716750a2a7f9970e572ab (diff)
downloadcaxlsx-173f1c49fb449aebc5ddf30a9387006ee54e5260.tar.gz
caxlsx-173f1c49fb449aebc5ddf30a9387006ee54e5260.zip
Fixes Issue #202 Axes are borked in Bar3DChart
Diffstat (limited to 'test/drawing/tc_axes.rb')
-rw-r--r--test/drawing/tc_axes.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/drawing/tc_axes.rb b/test/drawing/tc_axes.rb
new file mode 100644
index 00000000..caa242ad
--- /dev/null
+++ b/test/drawing/tc_axes.rb
@@ -0,0 +1,16 @@
+require 'tc_helper.rb'
+
+class TestAxes < Test::Unit::TestCase
+ def setup
+ @axes = Axlsx::Axes.new(:val_axis => Axlsx::ValAxis, :cat_axis => Axlsx::CatAxis)
+ end
+
+ def test_to_xml_string_just_ids
+ str = '<?xml version="1.0" encoding="UTF-8"?>'
+ str << '<c:chartSpace xmlns:c="' << Axlsx::XML_NS_C << '" xmlns:a="' << Axlsx::XML_NS_A << '">'
+ @axes.to_xml_string(str, :ids => true)
+ cat_axis_position = str.index(@axes[:cat_axis].id.to_s)
+ val_axis_position = str.index(@axes[:val_axis].id.to_s)
+ assert(cat_axis_position < val_axis_position, "cat_axis must occur earlier than val_axis in the XML")
+ end
+end \ No newline at end of file