Sha256: 463d7131dc9a0e3224a9f5ce7f7a99a37b57e416e7b9d8f53a3c84684d95770a

Contents?: true

Size: 977 Bytes

Versions: 19

Compression:

Stored size: 977 Bytes

Contents

# -*- coding: utf-8 -*-
require 'helper'
require 'write_xlsx'
require 'stringio'

class TestWriteFilters < Minitest::Test
  def setup
    @workbook = WriteXLSX.new(StringIO.new)
    @worksheet = @workbook.add_worksheet('')
  end

  def test_write_filters_East
    @worksheet.__send__('write_filters', 'East')
    result = @worksheet.instance_variable_get(:@writer).string
    expected = '<filters><filter val="East"/></filters>'
    assert_equal(expected, result)
  end

  def test_write_filters_East_South
    @worksheet.__send__('write_filters', 'East', 'South')
    result = @worksheet.instance_variable_get(:@writer).string
    expected = '<filters><filter val="East"/><filter val="South"/></filters>'
    assert_equal(expected, result)
  end

  def test_write_filters_blanks
    @worksheet.__send__('write_filters', 'blanks')
    result = @worksheet.instance_variable_get(:@writer).string
    expected = '<filters blank="1"/>'
    assert_equal(expected, result)
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
write_xlsx-1.09.4 test/worksheet/test_write_filters.rb
write_xlsx-1.09.3 test/worksheet/test_write_filters.rb
write_xlsx-1.09.2 test/worksheet/test_write_filters.rb
write_xlsx-1.09.1 test/worksheet/test_write_filters.rb
write_xlsx-1.09.0 test/worksheet/test_write_filters.rb
write_xlsx-1.08.2 test/worksheet/test_write_filters.rb
write_xlsx-1.08.1 test/worksheet/test_write_filters.rb
write_xlsx-1.08.0 test/worksheet/test_write_filters.rb
write_xlsx-1.07.0 test/worksheet/test_write_filters.rb
write_xlsx-1.04.0 test/worksheet/test_write_filters.rb
write_xlsx-1.02.0 test/worksheet/test_write_filters.rb
write_xlsx-1.01.0 test/worksheet/test_write_filters.rb
write_xlsx-1.00.0 test/worksheet/test_write_filters.rb
write_xlsx-0.99.0 test/worksheet/test_write_filters.rb
write_xlsx-0.97.0 test/worksheet/test_write_filters.rb
write_xlsx-0.90.0 test/worksheet/test_write_filters.rb
write_xlsx-0.89.0 test/worksheet/test_write_filters.rb
write_xlsx-0.88.0 test/worksheet/test_write_filters.rb
write_xlsx-0.87.0 test/worksheet/test_write_filters.rb