Sha256: 002c2cd5a19ce570aecca7cbff8fe99e479c4348886b2f5ef0a8600d5f237a0a

Contents?: true

Size: 671 Bytes

Versions: 7

Compression:

Stored size: 671 Bytes

Contents

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

class TestWriteFormula < Test::Unit::TestCase
  def setup
    @workbook = WriteExcel.new(StringIO.new)
    @worksheet = @workbook.add_worksheet('')
  end

  def teardown
    if @workbook.instance_variable_get(:@filehandle)
      @workbook.instance_variable_get(:@filehandle).close(true)
    end
    if @worksheet.instance_variable_get(:@filehandle)
      @worksheet.instance_variable_get(:@filehandle).close(true)
    end
  end

  def test_write_formula_does_not_change_formula_string
    formula = '=PI()'
    @worksheet.write('A1', formula)

    assert_equal('=PI()', formula)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
writeexcel-1.0.5 test/test_write_formula_does_not_change_formula_string.rb
writeexcel-1.0.4 test/test_write_formula_does_not_change_formula_string.rb
writeexcel-1.0.3 test/test_write_formula_does_not_change_formula_string.rb
writeexcel-1.0.2 test/test_write_formula_does_not_change_formula_string.rb
writeexcel-1.0.1 test/test_write_formula_does_not_change_formula_string.rb
writeexcel-1.0.0 test/test_write_formula_does_not_change_formula_string.rb
writeexcel-0.6.19 test/test_write_formula_does_not_change_formula_string.rb