Add support for each() on subjects.
Created by: ZenCocoon
I think the following example will give the idea behind each() on subjects.
# This ...
describe Object do
each(:item) { should be_an(Integer) }
end
# ... generates the same runtime structure as this:
describe Object do
describe "each item"
it "should be an Interger" do
subject.items.each do |item|
item.should be_an(Integer)
end
end
end
end
Includes : documented code, specs and feature. Tested under MRI1.8.7 and MRI1.9.2