Re: ruby and true
- From: Tim Hunter <TimHunter@xxxxxxxxx>
- Date: Tue, 1 May 2007 00:07:52 +0900
aidy.lewis@xxxxxxxxxxxxxx wrote:
Hi,Not knowing anything about what ie.contains_text does, it's hard for me to say why it might return 62 instead of TRUE. What is TRUE, anyway? Is it the same as "true", that is, the global value that is the single instance of TrueClass?
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
In Ruby, everything except false and nil are true. That is, all numbers including 0 are true, as are all strings including "". The global value "false" is the single instance of FalseClass, and the global value "nil" is the single instance of NilClass.
--
RMagick [http://rmagick.rubyforge.org]
RMagick Installation FAQ [http://rmagick.rubyforge.org/install-faq.html]
.
- References:
- ruby and true
- From: aidy . lewis
- ruby and true
- Prev by Date: http-access/2.0.7 RC
- Next by Date: Re: Checking Credit Cards (#122)
- Previous by thread: Re: ruby and true
- Next by thread: Re: ruby and true
- Index(es):