blob: 2cb029cc997be2edb39b07bb759e0062551fc7c4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
require 'tc_helper.rb'
class TestCatAxis < Test::Unit::TestCase
def setup
@axis = Axlsx::CatAxis.new
end
def teardown; end
def test_initialization
assert_equal(@axis.auto, 1, "axis auto default incorrect")
assert_equal(@axis.lbl_algn, :ctr, "label align default incorrect")
assert_equal(@axis.lbl_offset, "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_lbl_algn
assert_raise(ArgumentError, "requires valid label alignment") { @axis.lbl_algn = :nowhere }
assert_nothing_raised("accepts valid label alignment") { @axis.lbl_algn = :r }
end
def test_lbl_offset
assert_raise(ArgumentError, "requires valid label offset") { @axis.lbl_offset = 'foo' }
assert_nothing_raised("accepts valid label offset") { @axis.lbl_offset = "20" }
end
end
|