On Fri, Jan 16, 2009 at 12:14 PM, Juanma Cervera <li...@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@rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>



-- 
Aslak (::)
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to