Created
December 16, 2011 06:43
-
-
Save noahhendrix/1484834 to your computer and use it in GitHub Desktop.
Testing with datamapper
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 TaskList do | |
let(:list) { TaskList.new } | |
let(:todo) { mock('todo').as_null_object } | |
describe '#tasks' do | |
context 'without tasks' do | |
it 'returns an empty array' do | |
list.tasks.should be_empty | |
end | |
end | |
context 'with tasks' do | |
before(:each) { list.stub(:tasks).and_return [todo, todo, todo] } | |
it 'returns an array containing all tasks' do | |
list.tasks.should =~ [todo, todo, todo] | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment