free_mutant/spec/shared/each_method_behaviour.rb
Markus Schirp df6ccafeab Add method matcher infrastructure
Needs more specs for sure. Especially edge cases.
2012-07-23 22:54:35 +02:00

15 lines
311 B
Ruby

# encoding: utf-8
shared_examples_for 'an #each method' do
it_should_behave_like 'a command method'
context 'with no block' do
subject { object.each }
it { should be_instance_of(to_enum.class) }
it 'yields the expected values' do
subject.to_a.should eql(object.to_a)
end
end
end