Add Task#initialize spec

This commit is contained in:
Thibault Jouan 2013-08-07 01:22:46 +00:00
parent dff95b2c4b
commit 8123cf5052

View File

@ -6,6 +6,16 @@ module Producer::Core
let(:block) { proc { } }
subject(:task) { Task.new(name, &block) }
describe '#initialize' do
it 'assigns the name' do
expect(task.instance_eval { @name }).to eq name
end
it 'assigns the block' do
expect(task.instance_eval { @block }).to be block
end
end
describe '#name' do
it 'returns its name' do
expect(task.name).to eq name