Sha256: e15c2cb88476d1c43980abea4726054f507f58b1d631f75a9722588c2ddd8aa8

Contents?: true

Size: 1.79 KB

Versions: 9

Compression:

Stored size: 1.79 KB

Contents

# -*- coding: utf-8 -*-
require 'helper'
require 'write_xlsx/chart'

class TestWriteNumberFormat < Test::Unit::TestCase
  def setup
    @chart = Writexlsx::Chart.new('Bar')
  end

  def test_write_number_format
    expected = '<c:numFmt formatCode="General" sourceLinked="1"/>'
    result = @chart.__send__('write_number_format',
                             {
                               :_num_format => 'General',
                               :defaults    => { :num_format => 'General' }
                             }
                             )
    assert_equal(expected, result)
  end

  def test_write_number_format02
    expected = '<c:numFmt formatCode="#,##0.00" sourceLinked="0"/>'
    result = @chart.__send__('write_number_format',
                             {
                               :_num_format => '#,##0.00',
                               :_defaults   => { :num_format => 'General' }
                             }
                             )
    assert_equal(expected, result)
  end

  def test_write_number_format03
    expected = ''
    result = @chart.__send__('write_cat_number_format',
                             {
                               :_num_format => 'General',
                               :_defaults   => { :num_format => 'General' }
                             }
                             )
    assert_equal(expected, result)
  end

  def test_write_number_format04
    expected = '<c:numFmt formatCode="#,##0.00" sourceLinked="0"/>'
    result = @chart.__send__('write_cat_number_format',
                             {
                               :_num_format => '#,##0.00',
                               :_defaults   => { :num_format => 'General' }
                             }
                             )
    assert_equal(expected, result)
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
write_xlsx-0.62.0 test/chart/test_write_number_format.rb
write_xlsx-0.61.0 test/chart/test_write_number_format.rb
write_xlsx-0.60.0 test/chart/test_write_number_format.rb
write_xlsx-0.59.0 test/chart/test_write_number_format.rb
write_xlsx-0.58.0 test/chart/test_write_number_format.rb
write_xlsx-0.57.0 test/chart/test_write_number_format.rb
write_xlsx-0.56.0 test/chart/test_write_number_format.rb
write_xlsx-0.55.0 test/chart/test_write_number_format.rb
write_xlsx-0.54.0 test/chart/test_write_number_format.rb