test/stylesheet/tc_cell_alignment.rb in axlsx-1.0.17 vs test/stylesheet/tc_cell_alignment.rb in axlsx-1.0.18
- old
+ new
@@ -3,22 +3,27 @@
class TestCellAlignment < Test::Unit::TestCase
def setup
@item = Axlsx::CellAlignment.new
end
- def teardown
- end
+
def test_initialiation
assert_equal(@item.horizontal, nil)
assert_equal(@item.vertical, nil)
assert_equal(@item.textRotation, nil)
assert_equal(@item.wrapText, nil)
assert_equal(@item.indent, nil)
assert_equal(@item.relativeIndent, nil)
assert_equal(@item.justifyLastLine, nil)
assert_equal(@item.shrinkToFit, nil)
assert_equal(@item.readingOrder, nil)
-
+ options = { :horizontal => :left, :vertical => :top, :textRotation => 3,
+ :wrapText => true, :indent => 2, :relativeIndent => 5,
+ :justifyLastLine => true, :shrinkToFit => true, :readingOrder => 2 }
+ ca = Axlsx::CellAlignment.new options
+ options.each do |key, value|
+ assert_equal(ca.send(key.to_sym),value)
+ end
end
def test_horizontal
assert_raise(ArgumentError) { @item.horizontal = :red }
assert_nothing_raised { @item.horizontal = :left }