diff options
| author | Randy Morgan <[email protected]> | 2012-06-12 12:49:22 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-06-12 12:49:22 +0900 |
| commit | cd378cde3cc6db047f0e23c63980fdd6b240aafe (patch) | |
| tree | 76c80e1b3707dab3ad2655c32197654cf8293c5c /test | |
| parent | fb9da73d3fc36fe8de8f3631324183a867dc02ca (diff) | |
| download | caxlsx-cd378cde3cc6db047f0e23c63980fdd6b240aafe.tar.gz caxlsx-cd378cde3cc6db047f0e23c63980fdd6b240aafe.zip | |
more specs for axis labels
Diffstat (limited to 'test')
| -rw-r--r-- | test/drawing/tc_axis.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/drawing/tc_axis.rb b/test/drawing/tc_axis.rb index 46c8c956..3c5484ea 100644 --- a/test/drawing/tc_axis.rb +++ b/test/drawing/tc_axis.rb @@ -2,6 +2,7 @@ require 'tc_helper.rb' class TestAxis < Test::Unit::TestCase def setup + @axis = Axlsx::Axis.new 12345, 54321, :gridlines => false, :title => 'Foo' end @@ -18,6 +19,20 @@ class TestAxis < Test::Unit::TestCase assert_equal('Foo', @axis.title.text) end + def test_cell_based_axis_title + p = Axlsx::Package.new + p.workbook.add_worksheet(:name=>'foosheet') do |sheet| + sheet.add_row ['battle victories'] + sheet.add_row ['bird', 1, 2, 1] + sheet.add_row ['cat', 7, 9, 10] + sheet.add_chart(Axlsx::Line3DChart) do |chart| + chart.add_series :data => sheet['B2:D2'], :labels => sheet['B1'] + chart.valAxis.title = sheet['A1'] + assert_equal('battle victories', chart.valAxis.title.text) + end + end + end + def test_axis_position assert_raise(ArgumentError, "requires valid axis position") { @axis.axPos = :nowhere } assert_nothing_raised("accepts valid axis position") { @axis.axPos = :r } |
