Sha256: f5807f389c030a50d69577a3e580b2b939dceca8859afb9b83d59c739422fcd5

Contents?: true

Size: 670 Bytes

Versions: 4

Compression:

Stored size: 670 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 },
        { shell_command: 'bar', process_name: 'bar', dir: '/tmp', pid: 200 }
      ]
    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

4 entries across 4 versions & 1 rubygems

Version Path
invoker-1.3.2 spec/invoker/ipc/message/list_response_spec.rb
invoker-1.3.1 spec/invoker/ipc/message/list_response_spec.rb
invoker-1.3.0 spec/invoker/ipc/message/list_response_spec.rb
invoker-1.2.0 spec/invoker/ipc/message/list_response_spec.rb