On Dec 29, 2011, at 6:06 PM, niku -E:) wrote:

> When I execute following spec file, rspec can't be finish(can't display shell 
> prompt).
> How do I check StopIteration?
> 
> I'm using
> /Users/niku% ruby -v
> ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]
> /Users/niku% rspec -v
> 2.7.1
> 
> describe do
>   subject { [1,2].to_enum }
>   it do
>     # expect { 2.times{ subject.next } }. # failure, but it can be finish
>     expect { 3.times{ subject.next } }.
>       to raise_error(StopIteration)
>   end
> end


I can't reproduce this. Having copied your example as/is, I get the following:

=============================
$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]
[david: tmp]$ gem list rspec

*** LOCAL GEMS ***

rspec (2.7.0)
rspec-core (2.7.1)
rspec-expectations (2.7.0)
rspec-mocks (2.7.0)
[david: tmp]$ rspec example_spec.rb 
.

Finished in 0.13401 seconds
1 example, 0 failures
[david: tmp]$ 
=============================

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

Reply via email to