Sha256: b914c6d6538af4d32c9463e24923aa1358195bc8d1cd867ded0e63e96d5342d7

Contents?: true

Size: 714 Bytes

Versions: 12

Compression:

Stored size: 714 Bytes

Contents

require "spec_helper"

describe MM::ListResponse do
  context "serializing a response" do
    let(:process_array) do
      [
        { shell_command: 'foo', process_name: 'foo', dir: '/tmp', pid: 100,
          port: 9000 },
        { shell_command: 'bar', process_name: 'bar', dir: '/tmp', pid: 200,
          port: 9001 }
      ]
    end

    let(:message) { MM::ListResponse.new(processes: process_array) }

    it "should prepare proper json" do
      json_hash = message.as_json
      expect(json_hash[:type]).to eql "list_response"
      expect(json_hash[:processes].length).to eql 2
      expect(json_hash[:processes][0]).to be_a(Hash)
      expect(json_hash[:processes][1]).to be_a(Hash)
    end
  end
end

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
itrg-invoker-1.6.1 spec/invoker/ipc/message/list_response_spec.rb
itrg-invoker-1.6.0 spec/invoker/ipc/message/list_response_spec.rb
invoker-1.5.8 spec/invoker/ipc/message/list_response_spec.rb
invoker-1.5.7 spec/invoker/ipc/message/list_response_spec.rb
invoker-1.5.6 spec/invoker/ipc/message/list_response_spec.rb
invoker-1.5.5 spec/invoker/ipc/message/list_response_spec.rb
invoker-1.5.4 spec/invoker/ipc/message/list_response_spec.rb
invoker-1.5.3 spec/invoker/ipc/message/list_response_spec.rb
meepo-1.5.2 spec/invoker/ipc/message/list_response_spec.rb
invoker-1.5.1 spec/invoker/ipc/message/list_response_spec.rb
invoker-1.4.1 spec/invoker/ipc/message/list_response_spec.rb
invoker-1.4.0 spec/invoker/ipc/message/list_response_spec.rb