Skip to content

Add support for each() on subjects.

gitlab-qa-bot requested to merge github/fork/ZenCocoon/subject_each into master

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

Merge request reports