Ruby-Watit

  • Thread starter Uthpala Dissanayake
  • Start date
U

Uthpala Dissanayake

Uthpala said:
Hi,

I am using Watir to automate our regression test suite.

I have following question.

In watir I canot expand widgets.Could you please explan me the way to write scripts to expand the widgets using watir tool.

Please refer the screen shot for more information.
 
J

James French

SGksDQoNCkluIHJ1YnkgMS44LjcgdGhpcyBkb2VzIG5vdCB3b3JrIChzeW50YXggZXJyb3IpOg0K
DQpjbGFzcyBBDQoNCiAgZGVmIHRlc3Q9KHZhbCwgJmJsb2NrKQ0KICBlbmQNCg0KZW5kDQoNCkEu
bmV3LnRlc3QgPSAxMCBkbw0KZW5kDQoNCg0KSSB3b3VsZCByZWFsbHkgbGlrZSB0byBhbiBhc3Nv
Y2lhdGUgYSBibG9jayBpbiB0aGlzIHdheS4gSXMgdGhlcmUgYSB3YXkgcm91bmQgdGhpcz8NCg0K
Q2hlZXJzLA0KSmFtZXMNCg==
 
N

Nugroho Herucahyono

Whoaa... never do it this way, and it seems doesn't work in 1.9 too
and I agree with you, that it should works. Ruby's bug ??
 
J

James French

Thanks for checking this. I guess I should raise a bug report.

-----Original Message-----
From: Nugroho Herucahyono [mailto:[email protected]]=20
Sent: 11 June 2009 11:27
To: ruby-talk ML
Subject: Re: method=3D and block

Whoaa... never do it this way, and it seems doesn't work in 1.9 too
and I agree with you, that it should works. Ruby's bug ??
 
J

Joel VanderWerf

I'm pretty sure this is not a bug. It's been discussed once or twice
before on the ruby-talk list.

What are you trying to do with this syntax? Note the potential for
ambiguity:

A.new.test = [1,2,3].find do |i| i>1 end

This is currently parsed as

A.new.test = (
[1,2,3].find do |i| i>1 end
)
 
C

Christopher Dicely

I would really like to an associate a block in this way. Is there a way round this?

I don't think so. It isn't parsed as a normal method call, its parsed
as a special construct with the = that is converted into a method call
in a way which doesn't support picking up a block. I don't really
think that using = this way would be a good idea even if you could.
 
R

Robert Klemme

2009/6/12 Christopher Dicely said:
I don't think so. It isn't parsed as a normal method call, its parsed
as a special construct with the = that is converted into a method call
in a way which doesn't support picking up a block. I don't really
think that using = this way would be a good idea even if you could.

+1

If I see this

foo.bar = x do
something
end

I assume that "foo.bar" becomes the result of evaluating "x do ...
end". And the Ruby interpreter does so, too. Joel is absolutely
right about the ambiguity. Note also that this it is not possible to
somehow make a block work with a "regular" assignment (i.e. a direct
variable assignment):

bar = x do
something
end

Again, x will be called with the block and the result will be assigned
to bar. It would be a very bad idea IMHO to introduce inconsistencies
here. Please rather try to find a different solution. Note that you
can always do

def bar(&b)
@block = b
end

And then

foo.bar do
something
end

Kind regards

robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,172
Messages
2,570,934
Members
47,474
Latest member
AntoniaDea

Latest Threads

Top