summaryrefslogtreecommitdiffhomepage
path: root/test/stylesheet
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-05-13 14:40:31 +0900
committerRandy Morgan <[email protected]>2012-05-13 14:40:31 +0900
commitc2bdd517720d8f4640e7e06962417a4c5b0f02c7 (patch)
treed920ed1729d164fbcb4a13eda2c9236ca564dea3 /test/stylesheet
parentd46c97f6576aceaf30424b221188d80c7a4ecf64 (diff)
downloadcaxlsx-c2bdd517720d8f4640e7e06962417a4c5b0f02c7.tar.gz
caxlsx-c2bdd517720d8f4640e7e06962417a4c5b0f02c7.zip
MOAR specs
Diffstat (limited to 'test/stylesheet')
-rw-r--r--test/stylesheet/tc_gradient_fill.rb8
-rw-r--r--test/stylesheet/tc_pattern_fill.rb8
2 files changed, 15 insertions, 1 deletions
diff --git a/test/stylesheet/tc_gradient_fill.rb b/test/stylesheet/tc_gradient_fill.rb
index c252a498..546941d7 100644
--- a/test/stylesheet/tc_gradient_fill.rb
+++ b/test/stylesheet/tc_gradient_fill.rb
@@ -61,4 +61,12 @@ class TestGradientFill < Test::Unit::TestCase
assert(@item.stop.size == 1)
assert(@item.stop.last.is_a?(Axlsx::GradientStop))
end
+
+ def test_to_xml_string
+ @item.stop << Axlsx::GradientStop.new(Axlsx::Color.new(:rgb => "000000"), 0.5)
+ @item.stop << Axlsx::GradientStop.new(Axlsx::Color.new(:rgb => "FFFFFF"), 0.5)
+ @item.type = :path
+ doc = Nokogiri::XML(@item.to_xml_string)
+ assert(doc.xpath("//color[@rgb='FF000000']"))
+ end
end
diff --git a/test/stylesheet/tc_pattern_fill.rb b/test/stylesheet/tc_pattern_fill.rb
index 65ed0dd1..3895cffb 100644
--- a/test/stylesheet/tc_pattern_fill.rb
+++ b/test/stylesheet/tc_pattern_fill.rb
@@ -33,5 +33,11 @@ class TestPatternFill < Test::Unit::TestCase
assert_nothing_raised { @item.patternType = :lightUp }
assert_equal(@item.patternType, :lightUp)
end
-
+
+ def test_to_xml_string
+ @item = Axlsx::PatternFill.new :bgColor => Axlsx::Color.new(:rgb => "FF0000"), :fgColor => Axlsx::Color.new(:rgb=>"00FF00")
+ doc = Nokogiri::XML(@item.to_xml_string)
+ assert(doc.xpath('//color[@rgb="FFFF0000"]'))
+ assert(doc.xpath('//color[@rgb="FF00FF00"]'))
+ end
end