# -*- coding: utf-8 -*- require 'helper' class TestRegressionAutofilter09 < Minitest::Test def setup setup_dir_var end def teardown @tempfile.close(true) end def test_autofilter09 @xlsx = 'autofilter09.xlsx' workbook = WriteXLSX.new(@io) worksheet = workbook.add_worksheet # Extract the data embedded at the end of this file. data = [] data_lines.split(/\n/).each { |line| data << line.split } worksheet.write('A1', headings) # Create a blank cell in out test data. data[5][0] = '' worksheet.autofilter('A1:D51') worksheet.filter_column_list('A', %w(East North South)) # Hide the rows that don't match the filter criteria. row = 1 data.each do |row_data| region = row_data[0] if %w(East North South).include?(region) # Row is visible. else # Hide row. worksheet.set_row(row, nil, nil, 1) end worksheet.write(row, 0, row_data) row += 1 end workbook.close compare_for_regression( nil, {'xl/workbook.xml' => ['