Created
November 13, 2008 06:22
-
-
Save dchelimsky/24381 to your computer and use it in GitHub Desktop.
This file contains 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 'A Collection' do | |
subject { Collection.new } | |
action { clear } | |
should_return_self | |
should_clear_itself | |
end |
This file contains 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
def should_return_self | |
it "should return self" do | |
collection = subject | |
collection.instance_eval(&action).should equal(collection) | |
end | |
end | |
def should_clear_itself | |
it "should clear itself" do | |
collection = subject | |
collection << stuff | |
collection.instance_eval(&action) | |
collection.should be_empty | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment