Skip to content

Instantly share code, notes, and snippets.

@dchelimsky
Created November 13, 2008 06:22
Show Gist options
  • Save dchelimsky/24381 to your computer and use it in GitHub Desktop.
Save dchelimsky/24381 to your computer and use it in GitHub Desktop.
describe 'A Collection' do
subject { Collection.new }
action { clear }
should_return_self
should_clear_itself
end
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