Equality Problems

Below is a snip of code that I'm having problems with the test in
the .each method alway will return false and I don't have a clue why.
Could someone please help?

    print "ID=", @id
    print " QTY=", @qty,"\n"
    @cart.items.each{|x| print "ProdID=",x.product.id,"
QTY=",x.quantity," ",(x.quantity==(@qty)),"\n"}

Here is the output of the code above

ID=8 QTY=1
ProdID=8 QTY=1 false
ProdID=5 QTY=1 false
ProdID=7 QTY=1 false
ProdID=8 QTY=2 false
ProdID=8 QTY=3 false
ProdID=7 QTY=2 false

@qty is a string, x.quantity is an integer and so the 2 are never equal