# -*- coding: utf-8 -*- require 'helper' class TestWorksheetDataBar04 < Minitest::Test def setup @workbook = WriteXLSX.new(StringIO.new) @worksheet = @workbook.add_worksheet('') end ############################################################################### # # Tests for WriteXLSX::Worksheet methods. # # def test_data_bar_04 @worksheet.select @worksheet.instance_variable_set(:@index, 0) @worksheet.conditional_formatting( 'A1', :type => 'data_bar', :bar_solid => 1 ) @worksheet.conditional_formatting( 'A2:B2', :type => 'data_bar', :bar_color => '#63C384', :bar_no_border => 1 ) @worksheet.conditional_formatting( 'A3:C3', :type => 'data_bar', :bar_color => '#FF555A', :bar_border_color => '#FF0000' ) @worksheet.assemble_xml_file result = got_to_array(@worksheet.instance_variable_get(:@writer).string) expected = expected_to_array(expected_xml) assert_equal(expected, result) end def expected_xml < {DA7ABA51-AAAA-BBBB-0001-000000000001} {DA7ABA51-AAAA-BBBB-0001-000000000002} {DA7ABA51-AAAA-BBBB-0001-000000000003} A1 A2:B2 A3:C3 EOS end end