Created
October 25, 2011 19:19
-
-
Save jasonkarns/1313912 to your computer and use it in GitHub Desktop.
each_subjects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe ArModel do | |
context "when active" do | |
subject { ArModel.active } | |
each_subjects(:status_code) { should eql('ACTIVE') } | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module RSpec::Core::Subject::ClassMethods | |
def each_subjects(attribute, &block) | |
@explicit_subject_block.call.each do |sub| | |
subject {sub} | |
its(attribute, &block) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment