spec/kamerling/task_dispatcher_spec.rb in kamerling-0.0.1 vs spec/kamerling/task_dispatcher_spec.rb in kamerling-0.0.2
- old
+ new
@@ -8,15 +8,15 @@
project = fake :project, uuid: UUID['16B project UUID']
task = fake :task, data: 'data', uuid: UUID['16B task UUID']
repos = fake :repos, as: :class, projects: [project]
stub(repos).next_task_for(project) { task }
stub(repos).free_clients_for(project) { [client] }
- net_dispatcher = fake :net_dispatcher
+ net_dispatcher = fake :net_dispatcher, as: :class
TaskDispatcher.new(net_dispatcher: net_dispatcher, repos: repos).dispatch
- net_dispatcher.must_have_received :dispatch, [addr,
- "DATA#{"\0" * 12}16B client UUID16B project UUID16B task UUIDdata"]
+ header = "DATA#{"\0" * 12}16B client UUID16B project UUID16B task "
+ net_dispatcher.must_have_received :dispatch, [addr, header + 'UUIDdata']
client.must_have_received :busy=, [true]
repos.must_have_received :<<, [client]
end
end
end end