From: Mike Moore Date: 2007-05-01T00:00:12+09:00 Subject: Re: ruby and true ------=_Part_53722_30149040.1177945211120 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline In Ruby, boolean comparisons will always return true unless the value is nil or false. http://en.wikipedia.org/wiki/Boolean_datatype#Ruby On 4/30/07, aidy.lewis@googlemail.com wrote: > > Hi, > > I have some code the checks whether some text is on the HTML page > > @@log.test_results(ie.contains_text('Dashboard') > > I should get a TRUE (it's there), but it is returning the figure 62. > Is anything > 0 in Ruby true? If so, why, and shouldn't the object > automatically change to boolean? > > My xml then is falling through > > if result == TRUE then > test_status = @test.add_element 'teststatus' > test_status.text = 'PASS' > > > cheers > > aidy > > > ------=_Part_53722_30149040.1177945211120--