diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/drawing/tc_axis.rb | 6 | ||||
| -rw-r--r-- | test/tc_package.rb | 12 |
2 files changed, 13 insertions, 5 deletions
diff --git a/test/drawing/tc_axis.rb b/test/drawing/tc_axis.rb index 77eb61a1..46c8c956 100644 --- a/test/drawing/tc_axis.rb +++ b/test/drawing/tc_axis.rb @@ -2,8 +2,9 @@ require 'tc_helper.rb' class TestAxis < Test::Unit::TestCase def setup - @axis = Axlsx::Axis.new 12345, 54321, :gridlines => false + @axis = Axlsx::Axis.new 12345, 54321, :gridlines => false, :title => 'Foo' end + def teardown end @@ -14,6 +15,7 @@ class TestAxis < Test::Unit::TestCase assert_equal(@axis.crosses, :autoZero, "tick label position default incorrect") assert(@axis.scaling.is_a?(Axlsx::Scaling) && @axis.scaling.orientation == :minMax, "scaling default incorrect") assert_raise(ArgumentError) { Axlsx::Axis.new( -1234, 'abcd') } + assert_equal('Foo', @axis.title.text) end def test_axis_position @@ -57,6 +59,6 @@ class TestAxis < Test::Unit::TestCase assert(doc.xpath("//c:crosses[@val='#{@axis.crosses.to_s}']")) assert(doc.xpath("//c:crossAx[@val='#{@axis.crossAx.to_s}']")) assert(doc.xpath("//a:bodyPr[@rot='#{@axis.label_rotation.to_s}']")) - + assert(doc.xpath("//a:t[text()='Foo']")) end end diff --git a/test/tc_package.rb b/test/tc_package.rb index 3f214d6b..eedd2375 100644 --- a/test/tc_package.rb +++ b/test/tc_package.rb @@ -24,8 +24,14 @@ class TestPackage < Test::Unit::TestCase vs.add_selection(:bottom_right, { :active_cell => 'I57', :sqref => 'I57' }) end - chart = ws.add_chart Axlsx::Pie3DChart, :title => "これは?", :start_at => [0,3] - chart.add_series :data=>[1,2,3], :labels=>["a", "b", "c"] + ws.add_chart(Axlsx::Pie3DChart, :title => "これは?", :start_at => [0,3]) do |chart| + chart.add_series :data=>[1,2,3], :labels=>["a", "b", "c"] + end + + ws.add_chart(Axlsx::Line3DChart, :title => "axis labels") do |chart| + chart.valAxis.title = 'bob' + end + @fname = 'axlsx_test_serialization.xlsx' img = File.expand_path('../../examples/image1.jpeg', __FILE__) ws.add_image(:image_src => img, :noSelect => true, :noMove => true, :hyperlink=>"http://axlsx.blogspot.com") do |image| @@ -114,7 +120,7 @@ class TestPackage < Test::Unit::TestCase #no mystery parts - assert_equal(p.size, 18) + assert_equal(p.size, 19) end |
