Actually the input file contain is on the same 1st line : arr[0]
This is the csv external file dropList.csv contain:
:: Select Site :: !!Eastgate_Mall
I think my actual problem is when reading into an array and compare, it
did not separate :: Select Site :: as one field and ::
!!Eastgate_Mall to another field.
That why the expect is <[":: Select Site ::,!!Eastgate_Mall,\n"]
( missing separate double quotes)
Instead of <[":: Select Site ::", “!!Eastgate_Mall”]>.
Any one have any idea that I can separate the fields and make it work
with double quotes?
Thanks a lot!
From: Ban Hoang
Sent: Wednesday, August 23, 2006 9:27 AM
To: ‘[email protected]’
Cc: ‘[email protected]’; ‘[email protected]’
Subject: How do I strip off the extra double quote or white space in the
string when using assert_equal method
Hi,
I try to read in an external file to array and compare them to the drop
down list in our application. I got into the problem when comparing, the
extra double quotes make the assertion result failed. Can anyone help me
to make it work?
Thanks for your help,
ps . I posted this question on Nabble but it is pending without reason
so I try to post it here hope it can go to the list users…
Below is the code:
arr = IO.readlines(“dropList.csv”) # read entire contents of the file
into a single array. Each index of the array is one line.
assert_equal([arr[0]], $ie.frame(“top”).select_list(:name,
“site_id”).getAllContents)
This is the csv external file dropList.csv contain:
:: Select Site ::
!!Eastgate_Mall
- Failure:
test__02_DropDown_list_verified(TC_pulldownBoxVerified)
[DropVerified_test.rb:45]:
<[":: Select Site ::,!!Eastgate_Mall,\n"]> expected but was
<[":: Select Site ::", “!!Eastgate_Mall”]>.