Sha256: 00a9f27c42dfbd5bbc656375393b0484fde5b4b3d57dca8cfda0ebd2d694a94f

Contents?: true

Size: 1.25 KB

Versions: 7

Compression:

Stored size: 1.25 KB

Contents

require 'spec_helper'

describe Chimp::ChimpDaemon do
  let(:daemon) do
    Chimp::ChimpDaemon.instance
  end

  describe '#initialize' do
    it 'is a ChimpDaemon object' do
      expect(daemon).to be_a Chimp::ChimpDaemon
    end

    it 'has a ChimpQueue object inside @queue' do
      expect(daemon.queue).to be_a Chimp::ChimpQueue
    end
  end

  describe '#run' do
    # it 'should be able to spawn a webserver'
    # it 'should be able to run forever'
    # it 'should spawn a queue runner'
    # it 'should run_forever'
  end

  describe '#parse_command_line' do
    it 'should parse all parameters' do
      string = '--logfile=/tmp/test --verbose --concurrency=34 --port=9056'
      ARGV = string.split(' ')
      daemon.parse_command_line
      expect(daemon.concurrency).to eq 34
      expect(daemon.logfile).to eq '/tmp/test'
      expect(daemon.verbose).to eq true
      expect(daemon.port).to eq '9056'
    end
  end

  describe '#spawn_webserver' do
    it 'should spawn a webserver' do
      daemon.spawn_webserver
      expect(daemon.server).to be_a WEBrick::HTTPServer
    end
  end

  describe '#run_forever' do
  end

  describe '#install_signal_handlers' do
  end

  describe '#quit' do
  end

  describe '#spawn_chimpd_submission_processor' do
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
right_chimp-2.4 spec/chimp_daemon_spec.rb
right_chimp-2.3.2 spec/chimp_daemon_spec.rb
right_chimp-2.3.1 spec/chimp_daemon_spec.rb
right_chimp-2.3 spec/chimp_daemon_spec.rb
right_chimp-2.2.2 spec/chimp_daemon_spec.rb
right_chimp-2.2.1 spec/chimp_daemon_spec.rb
right_chimp-2.2 spec/chimp_daemon_spec.rb