Sha256: 01dad162da140d0d32fadf81e4fc69a0702a61e5a51dc5977f7212af9b453371

Contents?: true

Size: 975 Bytes

Versions: 11

Compression:

Stored size: 975 Bytes

Contents

require 'tc_helper.rb'

class TestCatAxis < Test::Unit::TestCase
  def setup
    @axis = Axlsx::CatAxis.new 12345, 54321
  end
  def teardown
  end

  def test_initialization
    assert_equal(@axis.auto, 1, "axis auto default incorrect")
    assert_equal(@axis.lblAlgn, :ctr, "label align default incorrect")
    assert_equal(@axis.lblOffset, "100", "label offset default incorrect")
  end

  def test_auto
    assert_raise(ArgumentError, "requires valid auto") { @axis.auto = :nowhere }
    assert_nothing_raised("accepts valid auto") { @axis.auto = false }
  end

  def test_lblAlgn
    assert_raise(ArgumentError, "requires valid label alignment") { @axis.lblAlgn = :nowhere }
    assert_nothing_raised("accepts valid label alignment") { @axis.lblAlgn = :r }
  end

  def test_lblOffset
    assert_raise(ArgumentError, "requires valid label offset") { @axis.lblOffset = 'foo' }
    assert_nothing_raised("accepts valid label offset") { @axis.lblOffset = "20" }
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
axlsx-1.3.5 test/drawing/tc_cat_axis.rb
axlsx-1.3.4 test/drawing/tc_cat_axis.rb
axlsx-1.3.3 test/drawing/tc_cat_axis.rb
axlsx-1.3.2 test/drawing/tc_cat_axis.rb
axlsx-1.3.1 test/drawing/tc_cat_axis.rb
axlsx-1.2.3 test/drawing/tc_cat_axis.rb
axlsx-1.2.2 test/drawing/tc_cat_axis.rb
axlsx-1.2.1 test/drawing/tc_cat_axis.rb
axlsx-1.2.0 test/drawing/tc_cat_axis.rb
axlsx-1.1.8 test/drawing/tc_cat_axis.rb
axlsx-1.1.7 test/drawing/tc_cat_axis.rb