diff options
| author | Randy Morgan <[email protected]> | 2011-11-20 23:22:04 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2011-11-20 23:22:04 +0900 |
| commit | e53f04284618713b0a90b7a691425c380e829476 (patch) | |
| tree | 801fea138160f9af426d62bf94ad5bf97123ece9 /test/stylesheet/tc_border_pr.rb | |
| download | caxlsx-e53f04284618713b0a90b7a691425c380e829476.tar.gz caxlsx-e53f04284618713b0a90b7a691425c380e829476.zip | |
first commit
Diffstat (limited to 'test/stylesheet/tc_border_pr.rb')
| -rw-r--r-- | test/stylesheet/tc_border_pr.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/stylesheet/tc_border_pr.rb b/test/stylesheet/tc_border_pr.rb new file mode 100644 index 00000000..18388186 --- /dev/null +++ b/test/stylesheet/tc_border_pr.rb @@ -0,0 +1,33 @@ +require 'test/unit' +require 'axlsx.rb' + +class TestBorderPr < Test::Unit::TestCase + def setup + @bpr = Axlsx::BorderPr.new + end + def teardown + end + def test_initialiation + assert_equal(@bpr.color, nil) + assert_equal(@bpr.style, nil) + assert_equal(@bpr.name, nil) + end + + def test_color + assert_raise(ArgumentError) { @bpr.color = :red } + assert_nothing_raised { @bpr.color = Axlsx::Color.new :rgb=>"FF000000" } + assert(@bpr.color.is_a?(Axlsx::Color)) + end + + def test_style + assert_raise(ArgumentError) { @bpr.style = :red } + assert_nothing_raised { @bpr.style = :thin } + assert_equal(@bpr.style, :thin) + end + + def test_name + assert_raise(ArgumentError) { @bpr.name = :red } + assert_nothing_raised { @bpr.name = :top } + assert_equal(@bpr.name, :top) + end +end |
