I am having the same problem reported on
http://groups.google.com/group/ruby-roo/browse_thread/thread/147aa9c2e28fe475/d2bd4c25d7b51469?lnk=gst&q=float#d2bd4c25d7b51469
My OpenOffice spreadsheet is as follows
1 + 2 3
5 - -1 6
0 / 3 0
... and is being parsed as 1.0 (Float), + (String), 2.0 (Float), 3.0
(Float), etc, even though I set the cell formatting to General or
Text.
How do you guys deal with this issue?
Thanks and regards,
FK
Hello Thomas
Let me explain a little better :)
I'm using Roo and Watir for data driven automated tests, so I wrote a
simple script to test http://www.bmgadg.com/calculator.php
My sheet is exactly like in the previous e-mail. I interact with the
calculator as defined in the file and compare the result of the
operations with assert_equal.
Since I can't round or truncate the numbers, all my tests fail:
<3.0> expected but was <"3">.
Here's a snippet of the code. Perhaps I'm just missing something :)
@OPERAND_1 = oo.cell(line,'A')
@OPERATOR = oo.cell(line,'B')
@OPERAND_2 = oo.cell(line,'C')
@EXPECTED_RESULT = oo.cell(line,'D')
puts "#{@OPERAND_1}\t#{@OPERATOR}\t#{@OPERAND_2}\t#{@EXPECTED_RESULT}"
@ie.text_field(:name, "win").value = @OPERAND_1
@ie.button(:value, @OPERATOR).click
@ie.text_field(:name, "win").value = @OPERAND_2
@ie.button(:value, "=").click
puts @ie.text_field(:name, "win").value
assert_equal(@EXPECTED_RESULT, @ie.text_field(:name, "win").value)
<3.0> expected but was <"3">.
assert_equal(@EXPECTED_RESULT, @ie.text_field(:name, "win").value)