Sha256: 45802234ae2868c8f2bef4c82b1b9d37544329f8bf488db9606fc8b1e54dc364

Contents?: true

Size: 975 Bytes

Versions: 2

Compression:

Stored size: 975 Bytes

Contents

Feature: Worker

  Scenario: Starting and stopping

    Given a file named "worker" with mode "744" and with:
      """
      #!/usr/bin/env ruby
      $LOAD_PATH << File.expand_path("../../../lib", __FILE__)
      require "daemonic"

      class MyWorker

        def produce(queue)
          sleep 0.1
          queue << "tick"
        end

        def consume(message)
          puts message
          sleep 0.1
        end

      end

      worker = MyWorker.new

      Daemonic.run(worker)
      """

    When I run `./worker start --daemonize --pid tmp/worker.pid`
    Then the exit status should be 0

    When I run `./worker status --pid tmp/worker.pid`
    Then the exit status should be 0

    When I run `./worker restart --pid tmp/worker.pid`
    Then the exit status should be 0

    When I run `./worker stop --pid tmp/worker.pid`
    Then the exit status should be 0

    When I run `./worker status --pid tmp/worker.pid`
    Then the exit status should be 2

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
daemonic-0.1.1 features/worker.feature
daemonic-0.1.0 features/worker.feature