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