Sha256: ffd53a2fae87e30944d5bca905de6b7537f22de478b4d6d83ec3c31318fb90a0

Contents?: true

Size: 756 Bytes

Versions: 20

Compression:

Stored size: 756 Bytes

Contents

require "spec_helper"

describe Invoker::Daemon do
  let(:daemon) { Invoker::Daemon.new}

  describe "#start" do
    context "when daemon is aleady running" do
      it "exits without any error" do
        daemon.expects(:running?).returns(true)
        begin
          daemon.start
        rescue SystemExit => e
          expect(e.status).to be(0)
        end
      end
    end

    context "when daemon is not running" do
      it "starts the daemon" do
        daemon.expects(:dead?).returns(false)
        daemon.expects(:running?).returns(false)
        daemon.expects(:daemonize)
        daemon.start
      end
    end
  end

  describe "#stop" do
    it "stops the daemon" do
      daemon.expects(:kill_process)
      daemon.stop
    end
  end
end

Version data entries

20 entries across 20 versions & 3 rubygems

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