From: Ban Hoang Date: 2006-08-24T03:57:20+09:00 Subject: Re: How do I strip off the extra double quote or white space in the string when using assert_equal method ------_=_NextPart_001_01C6C6E5.F5A905BC Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Actually the input file contain is on the same 1st line : arr[0] ------------------------------------------------------------------------ ---------------- =20 This is the csv external file dropList.csv contain:=20 :: Select Site :: !!Eastgate_Mall=20 -------------------------------------- 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. =20 That why the expect is <[":: Select Site ::,!!Eastgate_Mall,,,,,\n"] ( missing separate double quotes) Instead of <[":: Select Site ::", "!!Eastgate_Mall"]>. =20 Any one have any idea that I can separate the fields and make it work with double quotes? =20 Thanks a lot! ________________________________ From: Ban Hoang=20 Sent: Wednesday, August 23, 2006 9:27 AM To: 'ruby-talk@ruby-lang.org' Cc: 'all.nabble@gmail.com'; 'support@nabble.com' Subject: How do I strip off the extra double quote or white space in the string when using assert_equal method =20 =20 Hi,=20 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?=20 Thanks for your help,=20 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... =20 ************************ Below is the code:=20 ------------=20 arr =3D IO.readlines("dropList.csv") # read entire contents of the = file into a single array. Each index of the array is one line.=20 assert_equal([arr[0]], $ie.frame("top").select_list(:name, "site_id").getAllContents)=20 ------------------=20 This is the csv external file dropList.csv contain:=20 :: Select Site ::=20 !!Eastgate_Mall=20 -----------------------------=20 1) Failure:=20 test__02_DropDown_list_verified(TC_pulldownBoxVerified) [DropVerified_test.rb:45]:=20 <[":: Select Site ::,!!Eastgate_Mall,,,,,\n"]> expected but was=20 <[":: Select Site ::", "!!Eastgate_Mall"]>.=20 =20 =20 =20 ------_=_NextPart_001_01C6C6E5.F5A905BC--