On Fri, Jan 16, 2009 at 12:14 PM, Juanma Cervera <lists at ruby-forum.com>wrote:
> Ok.
>> I have solved my problem.
>> Because I am using spanish for wrinting my features, I didn't paste the
> exact sentences of the code I was using, and pasted instead a
> "manual-translated similar" code.
> And nobody could see the problem. Never more.
>> The problem was that I was writing the block for the have_selector with
> do...end instead of {...}
> And it didn't work in these case.
> Is this a bug or is it a special feature of this construct.
>
You have to use {} in this case. {} and do..end have different precedence
rules in the Ruby language.
In this case, when you use do..end, the block gets sent to the #should
method (the leftmost), but if you use {} it gets sent to the #have_selector
method (the rightmost).
Aslak
>> Juanma Cervera
>> --
> Posted via http://www.ruby-forum.com/.> _______________________________________________
> rspec-users mailing list
>rspec-users at rubyforge.org>http://rubyforge.org/mailman/listinfo/rspec-users>
--
Aslak (::)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090116/43989240/attachment-0001.html>