summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorTrent Ogren <[email protected]>2013-08-08 13:34:17 -0500
committerTrent Ogren <[email protected]>2013-08-08 13:34:17 -0500
commit6661350bcdd074b6bbc4cf277d65ef5856cb22ac (patch)
tree2069313733b9e8d3159526df6774aade87c47189 /test
parent2c3a0b821abaef509fefee0f6e096073180c3337 (diff)
downloadcaxlsx-6661350bcdd074b6bbc4cf277d65ef5856cb22ac.tar.gz
caxlsx-6661350bcdd074b6bbc4cf277d65ef5856cb22ac.zip
Don't mutate the object passed into Color#rgb=
Diffstat (limited to 'test')
-rw-r--r--test/stylesheet/tc_color.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/stylesheet/tc_color.rb b/test/stylesheet/tc_color.rb
index affa2227..dd8e98d2 100644
--- a/test/stylesheet/tc_color.rb
+++ b/test/stylesheet/tc_color.rb
@@ -27,6 +27,12 @@ class TestColor < Test::Unit::TestCase
assert_equal(@item.rgb, "FF00FF00" )
end
+ def test_rgb_writer_doesnt_mutate_its_argument
+ my_rgb = 'ff00ff00'
+ @item.rgb = my_rgb
+ assert_equal 'ff00ff00', my_rgb
+ end
+
def test_tint
assert_raise(ArgumentError) { @item.tint = -1 }
assert_nothing_raised { @item.tint = -1.0 }