Sha256: bb594e96e8dbeb9bf5675834c13dfa56671b77f8d764b2931da3a61eff6ed25f

Contents?: true

Size: 843 Bytes

Versions: 1

Compression:

Stored size: 843 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
      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.new(addr: addr, client: client,
        data: 'data', task: task, uuid: anything)]
    end
  end
end end

Version data entries

1 entries across 1 versions & 1 rubygems

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