# -*- coding: utf-8 -*- require 'helper' class TestWorksheetDataBar07 < Minitest::Test def setup @workbook = WriteXLSX.new(StringIO.new) @worksheet = @workbook.add_worksheet('') end ############################################################################### # # Tests for WriteXLSX::Worksheet methods. # # def test_data_bar_07 @worksheet.select @worksheet.instance_variable_set(:@index, 0) @worksheet.conditional_formatting( 'A1', :type => 'data_bar', :bar_axis_position => 'middle' ) @worksheet.conditional_formatting( 'A2:B2', :type => 'data_bar', :bar_color => '#63C384', :bar_axis_position => 'none' ) @worksheet.conditional_formatting( 'A3:C3', :type => 'data_bar', :bar_color => '#FF555A', :bar_axis_color => '#0070C0' ) @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