Mark Wilden wrote:
>
> 
> The thing is that the Ruby idiom is to avoid unnecessary returns. 
> Because of  this, using them actually makes code harder to read,
> because you have to read it more carefully to see if they're being
> used for a legitimate reason.

If the method is short, the code simply falls through, and I am not 
doing anything particularly subtle with the result, then I follow the 
convention of no explicit return.  If a method requires at least one 
explicit return then I code all possible outcomes as returns.  In such a 
case, one _should_ be reading the code more carefully, particularly if 
one is writing it.

But, we digress.  I am still looking for suggestions on recommended 
approaches to testing application code that is dependent upon 
environment.rb config values.

-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to