Sha256: 20d94c501d4b56ded2a2ea22ae99a37d4c3a12d192f259397e252194dd58cc96

Contents?: true

Size: 801 Bytes

Versions: 2

Compression:

Stored size: 801 Bytes

Contents

require 'spec_helper'

describe Virginia::Service do
  class DummyHandler
    def initialize(host, port)
    end
  end

  let(:host)    { "127.0.0.1" }
  let(:port)    { 8989 }
  let(:options) { {Host: host, Port: port} }

  before :each do
    Adhearsion.stub(:root).and_return '.'
    Adhearsion.config.virginia.host   = host
    Adhearsion.config.virginia.port   = port
    Adhearsion.config.virginia.rackup = 'spec/fixtures/config.ru'
  end

  it "should instantiate the handler" do
    rack_logger = mock 'Rack::CommonLogger'
    ::Rack::CommonLogger.should_receive(:new).once.with(TestApp, Adhearsion.logger).and_return rack_logger
    ::Reel::Rack::Server.should_receive(:supervise_as).once.with(:reel_rack_server, rack_logger, options)
    Virginia::Service.start
  end
end

class TestApp
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
virginia-0.4.0 spec/virginia/service_spec.rb
virginia-0.3.0 spec/virginia/service_spec.rb