Rename Worker class as Interpreter
This commit is contained in:
24
spec/producer/core/interpreter_spec.rb
Normal file
24
spec/producer/core/interpreter_spec.rb
Normal file
@@ -0,0 +1,24 @@
|
||||
require 'spec_helper'
|
||||
|
||||
module Producer::Core
|
||||
describe Interpreter do
|
||||
subject(:interpreter) { Interpreter.new }
|
||||
|
||||
describe '#process' do
|
||||
it 'processes each task' do
|
||||
expect(interpreter).to receive(:process_task).with(:some_task)
|
||||
interpreter.process [:some_task]
|
||||
end
|
||||
end
|
||||
|
||||
describe '#process_task' do
|
||||
it 'applies the task actions' do
|
||||
action = double('action')
|
||||
task = double('task')
|
||||
allow(task).to receive(:actions) { [action] }
|
||||
expect(action).to receive(:apply)
|
||||
interpreter.process_task(task)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user