[rspec-users] Style issue

James Byrne lists at ruby-forum.com
Thu Apr 23 16:18:59 EDT 2009

Mark Wilden wrote:

> I find this more straighforward and easy to understand:
>  When /currency exchange rate transfer file should contain rates/ do
>   fx_code = 'USD'
>   File.open(FOREX_XFR_FN).each do |line|
>     return true if
> /.*fx_target#{fx_code}.*fx_rate(\d+\.\d{4}).*/.match(line)
>   end
>   fail(ArgumentError, "Exchange Rate not found for #{fx_code}")
>  end
> ///ark

If I do a return from inside the iterator then I get a jump error.  It 
has to be break, which is how I ended up with what I did.
Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list