spec/processor/yielder_spec.rb in pupa-0.1.11 vs spec/processor/yielder_spec.rb in pupa-0.2.0

- old
+ new

@@ -19,34 +19,34 @@ it 'should iterate over the items in the enumeration' do array = [] yielder.each do |n| array << n end - array.should == (0..9).to_a + expect(array).to eq((0..9).to_a) end it 'should be composable with other iterators' do - yielder.each.map{|n| n}.should == (0..9).to_a + expect(yielder.each.map{|n| n}).to eq((0..9).to_a) end end describe '#next' do it 'should return the next item in the enumeration' do array = [] 10.times do |n| array << yielder.next end - array.should == (0..9).to_a + expect(array).to eq((0..9).to_a) end it 'should raise an error if the enumerator is at the end' do expect{11.times{yielder.next}}.to raise_error(StopIteration) end end describe '#to_enum' do it 'should return an enumerator' do - yielder.to_enum.should be_a(Enumerator) + expect(yielder.to_enum).to be_a(Enumerator) end it 'should return a lazy enumerator' do expect{raiser.to_enum}.to_not raise_error end