On Thu, Aug 24, 2006, Ban Hoang wrote:
> 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? 

A couple of options:

1) If your external file is truly CSV (comma-separated values) use a CSV
parser to parse it.  Though, from your example, it doesn't seem to be
the case... here's some code anyway.

.....
require 'csv'

rows = []

CSV.open('dropList.csv', 'r') do |row|
  rows << row
end
.....

Then compare the parsed rows against your dropdown array.

2) Write your own assertion:

.....
def assert_equal_without_quotes(a,b)
  assert_equal a.gsub(/['"]/, ''), b.gsub(/['"]/, '')
end
.....

Untested, but that might work ;)

Ben