Sha256: d525dabcf59b7ad27ddf8dbce62744934c34de7a1bea5455df64919a5d64e788

Contents?: true

Size: 913 Bytes

Versions: 1

Compression:

Stored size: 913 Bytes

Contents

require_relative '../spec_helper'

module Kamerling describe Receiver do
  describe '#receive' do
    fakes :addr, :client, :task

    it 'saves the result and updates client and task' do
      repos = fake :repos, as: :class
      stub(repos).<<(any_args) { repos }
      stub(repos).[](Client)   { fake :repo, :[] => client }
      stub(repos).[](Task)     { fake :repo, :[] => task   }
      Receiver.new.receive addr: addr, client_uuid: client.uuid, data: 'data',
                           repos: repos, task_uuid: task.uuid
      result = Result.new addr: addr, client: client, data: 'data', task: task,
                          uuid: anything
      client.must_have_received :busy=, [false]
      task.must_have_received   :done=, [true]
      repos.must_have_received  :<<,    [client]
      repos.must_have_received  :<<,    [task]
      repos.must_have_received  :<<,    [result]
    end
  end
end end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kamerling-0.0.2 spec/kamerling/receiver_spec.rb