Sha256: 944f14dd665ffbc77455efa1b8b95795dfaf0e904e535692bb9ba66a0fcd361a
Contents?: true
Size: 674 Bytes
Versions: 4
Compression:
Stored size: 674 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]).to have(2).elements 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