Implement task evaluation feature

This commit is contained in:
Thibault Jouan
2013-07-27 23:53:12 +00:00
parent c7295fb977
commit baaa957e9e
6 changed files with 77 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
require 'spec_helper'
module Producer::Core
describe Task do
let(:name) { :some_task }
let(:block) { }
subject(:task) { Task.new(name, &block) }
describe '#name' do
it 'returns its name' do
expect(task.name).to eq name
end
end
describe 'evaluate' do
let(:block) { Proc.new { raise 'error from task' } }
it 'evaluates its block' do
expect { task.evaluate }.to raise_error(RuntimeError, 'error from task')
end
end
end
end