Sha256: 112c6b82cfc58fb70261d5dc421c1ea78e0d2c92a4451d1b962d634bd5ede4af

Contents?: true

Size: 998 Bytes

Versions: 7

Compression:

Stored size: 998 Bytes

Contents

require 'test/unit'
require 'axlsx.rb'

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

  def test_initialization
    assert_equal(@axis.auto, true, "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 = 100 }
    assert_nothing_raised("accepts valid label offset") { @axis.lblOffset = "20%" }
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
axlsx-1.0.7 test/drawing/tc_val_axis.rb~
axlsx-1.0.6 test/drawing/tc_val_axis.rb~
axlsx-1.0.5 test/drawing/tc_val_axis.rb~
axlsx-1.0.4 test/drawing/tc_val_axis.rb~
axlsx-1.0.3 test/drawing/tc_val_axis.rb~
axlsx-1.0.1 test/drawing/tc_val_axis.rb~
axlsx-1.0.0 test/drawing/tc_val_axis.rb~