On Aug 18, 2010, at 11:31 AM, rogerdpack wrote:

> Sorry if this is a newbie question, but here goes.
> 
> I was wondering if the following is somehow possible:
> 
> 
>  for file in Dir['*.bmp']

Use this instead:

Dir["*.bmp"].each do |file| 
>    it "should be able to parse #{file}" do
>      p file
>      # test this file
>    end
>  end
> 
> Currently rspec seems to evaluate the blocks after the fact, leading
> to "file" always being the last file in the list.
> I was unsure how to pass a parameter into an "it" block.
> Thoughts?
> Thanks.
> -r


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

Reply via email to