Sha256: f613ce0c8818951ba97ed2ce3bb3ffc3c012967091190110ec6bc0926f4b2c7d

Contents?: true

Size: 646 Bytes

Versions: 16

Compression:

Stored size: 646 Bytes

Contents

require "spec_helper"

describe Invoker::CLI::Pinger do
  let(:unix_client) { Invoker::IPC::UnixClient.new }
  let(:pinger) { Invoker::CLI::Pinger.new(unix_client) }
  let(:pong) { MM::Pong.new(status: 'pong') }

  context "If Invoker is running" do
    it "should return true" do
      unix_client.expects(:send_and_receive).returns(pong)
      expect(pinger.invoker_running?).to be_truthy
    end
  end

  context "if Invoker is not running" do
    it "should return false" do
      unix_client.expects(:send_and_receive).returns(nil)
      unix_client.expects(:abort).never
      expect(pinger.invoker_running?).to be_falsey
    end
  end
end

Version data entries

16 entries across 16 versions & 3 rubygems

Version Path
itrg-invoker-1.6.1 spec/invoker/cli/pinger_spec.rb
itrg-invoker-1.6.0 spec/invoker/cli/pinger_spec.rb
invoker-1.5.8 spec/invoker/cli/pinger_spec.rb
invoker-1.5.7 spec/invoker/cli/pinger_spec.rb
invoker-1.5.6 spec/invoker/cli/pinger_spec.rb
invoker-1.5.5 spec/invoker/cli/pinger_spec.rb
invoker-1.5.4 spec/invoker/cli/pinger_spec.rb
invoker-1.5.3 spec/invoker/cli/pinger_spec.rb
meepo-1.5.2 spec/invoker/cli/pinger_spec.rb
invoker-1.5.1 spec/invoker/cli/pinger_spec.rb
invoker-1.4.1 spec/invoker/cli/pinger_spec.rb
invoker-1.4.0 spec/invoker/cli/pinger_spec.rb
invoker-1.3.2 spec/invoker/cli/pinger_spec.rb
invoker-1.3.1 spec/invoker/cli/pinger_spec.rb
invoker-1.3.0 spec/invoker/cli/pinger_spec.rb
invoker-1.2.0 spec/invoker/cli/pinger_spec.rb