Sha256: 472e274f8426fed8b6ca540060a18dd357a640f64d020d988eefc5b01caf32ab

Contents?: true

Size: 1.3 KB

Versions: 2

Compression:

Stored size: 1.3 KB

Contents

require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")

module Polonium
  describe MongrelSeleniumServerRunner, "#start_server" do
    attr_reader :configuration
    before do
      @configuration = Configuration.new
    end

    it "initializes server and runs app_server_initialization callback" do
      mongrel_configurator = configuration.create_mongrel_configurator
      stub(configuration).create_mongrel_configurator {mongrel_configurator}
      mock(mongrel_configurator).run
      stub(mongrel_configurator).log
      mock(mongrel_configurator).join
      fake_rails = "fake rails"
      mock(mongrel_configurator).rails {fake_rails}
      mock(mongrel_configurator).uri("/", {:handler => fake_rails})
      mock(mongrel_configurator).load_plugins
      mock(mongrel_configurator).listener.yields(mongrel_configurator)

      callback_mongrel = nil
      configuration.app_server_initialization = proc do |mongrel|
        callback_mongrel = mongrel
      end
      runner = configuration.create_mongrel_runner
      stub(runner).defaults do; {:environment => ""}; end
      runner.thread_class = mock_thread_class = "mock_thread_class"
      mock(mock_thread_class).start.yields

      runner.start
      callback_mongrel.should == mongrel_configurator
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
polonium-0.1.0 spec/polonium/mongrel_selenium_server_runner_spec.rb
polonium-0.1.1 spec/polonium/mongrel_selenium_server_runner_spec.rb