summaryrefslogtreecommitdiffhomepage
path: root/test/stylesheet/tc_color.rb
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2011-11-20 23:22:04 +0900
committerRandy Morgan <[email protected]>2011-11-20 23:22:04 +0900
commite53f04284618713b0a90b7a691425c380e829476 (patch)
tree801fea138160f9af426d62bf94ad5bf97123ece9 /test/stylesheet/tc_color.rb
downloadcaxlsx-e53f04284618713b0a90b7a691425c380e829476.tar.gz
caxlsx-e53f04284618713b0a90b7a691425c380e829476.zip
first commit
Diffstat (limited to 'test/stylesheet/tc_color.rb')
-rw-r--r--test/stylesheet/tc_color.rb38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/stylesheet/tc_color.rb b/test/stylesheet/tc_color.rb
new file mode 100644
index 00000000..55f69448
--- /dev/null
+++ b/test/stylesheet/tc_color.rb
@@ -0,0 +1,38 @@
+require 'test/unit'
+require 'axlsx.rb'
+
+class TestColor < Test::Unit::TestCase
+
+ def setup
+ @item = Axlsx::Color.new
+ end
+
+ def teardown
+ end
+
+ def test_initialiation
+ assert_equal(@item.auto, nil)
+ assert_equal(@item.rgb, "FF000000")
+ assert_equal(@item.tint, nil)
+ end
+
+ def test_auto
+ assert_raise(ArgumentError) { @item.auto = -1 }
+ assert_nothing_raised { @item.auto = true }
+ assert_equal(@item.auto, true )
+ end
+
+ def test_rgb
+ assert_raise(ArgumentError) { @item.rgb = -1 }
+ assert_nothing_raised { @item.rgb = "FF00FF00" }
+ assert_equal(@item.rgb, "FF00FF00" )
+ end
+
+ def test_tint
+ assert_raise(ArgumentError) { @item.tint = -1 }
+ assert_nothing_raised { @item.tint = -1.0 }
+ assert_equal(@item.tint, -1.0 )
+ end
+
+
+end