Sha256: 85c2880929ff51727efcb51fcbc414878d420d7c747bf00e2b9c73d86ffcbbbd
Contents?: true
Size: 1.16 KB
Versions: 10
Compression:
Stored size: 1.16 KB
Contents
require 'tc_helper.rb' class TestDataBar < Test::Unit::TestCase def setup @data_bar = Axlsx::DataBar.new :color => "FF638EC6" end def test_defaults assert_equal @data_bar.minLength, 10 assert_equal @data_bar.maxLength, 90 assert_equal @data_bar.showValue, true end def test_minLength assert_raise(ArgumentError) { @data_bar.minLength = :invalid_type } assert_nothing_raised { @data_bar.minLength = 0} assert_equal(@data_bar.minLength, 0) end def test_maxLength assert_raise(ArgumentError) { @data_bar.maxLength = :invalid_type } assert_nothing_raised { @data_bar.maxLength = 0} assert_equal(@data_bar.maxLength, 0) end def test_showValue assert_raise(ArgumentError) { @data_bar.showValue = :invalid_type } assert_nothing_raised { @data_bar.showValue = false} assert_equal(@data_bar.showValue, false) end def test_to_xml_string doc = Nokogiri::XML.parse(@data_bar.to_xml_string) assert_equal(doc.xpath(".//dataBar[@minLength=10][@maxLength=90][@showValue='true']").size, 1) assert_equal(doc.xpath(".//dataBar//cfvo").size, 2) assert_equal(doc.xpath(".//dataBar//color").size, 1) end end
Version data entries
10 entries across 10 versions & 1 rubygems