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_gradient_stop.rb | |
| download | caxlsx-e53f04284618713b0a90b7a691425c380e829476.tar.gz caxlsx-e53f04284618713b0a90b7a691425c380e829476.zip | |
first commit
Diffstat (limited to 'test/stylesheet/tc_gradient_stop.rb')
| -rw-r--r-- | test/stylesheet/tc_gradient_stop.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/stylesheet/tc_gradient_stop.rb b/test/stylesheet/tc_gradient_stop.rb new file mode 100644 index 00000000..d7735231 --- /dev/null +++ b/test/stylesheet/tc_gradient_stop.rb @@ -0,0 +1,32 @@ +require 'test/unit' +require 'axlsx.rb' + +class TestGradientStop < Test::Unit::TestCase + + def setup + @item = Axlsx::GradientStop.new(Axlsx::Color.new(:rgb=>"FFFF0000"), 1.0) + end + + def teardown + end + + + def test_initialiation + assert_equal(@item.color.rgb, "FFFF0000") + assert_equal(@item.position, 1.0) + end + + def test_position + assert_raise(ArgumentError) { @item.position = -1.1 } + assert_nothing_raised { @item.position = 0.0 } + assert_equal(@item.position, 0.0) + end + + def test_color + assert_raise(ArgumentError) { @item.color = nil } + color = Axlsx::Color.new(:rgb=>"FF0000FF") + @item.color = color + assert_equal(@item.color.rgb, "FF0000FF") + end + +end |
