Sha256: 1b0561117b7520067c53bc9b5610a8e81ae1d6b5fa8168d580e48a9871c9b37a

Contents?: true

Size: 1.01 KB

Versions: 20

Compression:

Stored size: 1.01 KB

Contents

require 'spec_helper'

describe Invoker::IPC::DnsCheckCommand do
  let(:client_socket) { StringIO.new }
  let(:client) { Invoker::IPC::ClientHandler.new(client_socket) }

  describe "dns check for valid process" do
    let(:message_object) { MM::DnsCheck.new(process_name: 'lolbro') }
    it "should response with dns check response" do
      invoker_dns_cache.expects(:[]).returns('port' => 9000)
      client_socket.string = message_object.encoded_message

      client.read_and_execute

      dns_check_response = client_socket.string
      expect(dns_check_response).to match(/9000/)
    end
  end

  describe "dns check for invalid process" do
    let(:message_object) { MM::DnsCheck.new(process_name: 'foo') }
    it "should response with dns check response" do
      invoker_dns_cache.expects(:[]).returns('port' => nil)
      client_socket.string = message_object.encoded_message

      client.read_and_execute

      dns_check_response = client_socket.string
      expect(dns_check_response).to match(/null/)
    end
  end
end

Version data entries

20 entries across 20 versions & 3 rubygems

Version Path
itrg-invoker-1.6.1 spec/invoker/ipc/dns_check_command_spec.rb
itrg-invoker-1.6.0 spec/invoker/ipc/dns_check_command_spec.rb
invoker-1.5.8 spec/invoker/ipc/dns_check_command_spec.rb
invoker-1.5.7 spec/invoker/ipc/dns_check_command_spec.rb
invoker-1.5.6 spec/invoker/ipc/dns_check_command_spec.rb
invoker-1.5.5 spec/invoker/ipc/dns_check_command_spec.rb
invoker-1.5.4 spec/invoker/ipc/dns_check_command_spec.rb
invoker-1.5.3 spec/invoker/ipc/dns_check_command_spec.rb
meepo-1.5.2 spec/invoker/ipc/dns_check_command_spec.rb
invoker-1.5.1 spec/invoker/ipc/dns_check_command_spec.rb
invoker-1.4.1 spec/invoker/ipc/dns_check_command_spec.rb
invoker-1.4.0 spec/invoker/ipc/dns_check_command_spec.rb
invoker-1.3.2 spec/invoker/ipc/dns_check_command_spec.rb
invoker-1.3.1 spec/invoker/ipc/dns_check_command_spec.rb
invoker-1.3.0 spec/invoker/ipc/dns_check_command_spec.rb
invoker-1.2.0 spec/invoker/ipc/dns_check_command_spec.rb
invoker-1.2.0.pre2 spec/invoker/ipc/dns_check_command_spec.rb
invoker-1.2.0.pre1 spec/invoker/ipc/dns_check_command_spec.rb
invoker-1.2.0.pre spec/invoker/ipc/dns_check_command_spec.rb
invoker-1.1.0 spec/invoker/ipc/dns_check_command_spec.rb