Sha256: b1c3f5c07e4b0ac0961f57147b99908341b4fa394e6a03ec5770a79ebd02ac72

Contents?: true

Size: 837 Bytes

Versions: 14

Compression:

Stored size: 837 Bytes

Contents

require 'test/unit'
require File.dirname(__FILE__) + '/test_helper.rb'
require 'test_server/server'

class ServerTest < Test::Unit::TestCase
  def setup
    @runner = stub(:run => nil)
    @rails = stub(:reload_application => nil, :cleanup_application => nil)
    @server = TestServer::Server.new
    @server.stubs(:rails).returns @rails
  end
  
  
  def test_parse_opts_recognizes_daemon_and_pid_argvs
    argv = ["--daemon", "--pid=1"]
    expected = { :daemon => true, :pid => '1' }
    assert_equal expected, @server.send(:parse_opts, argv)
  end
  
  def test_run_calls_callbacks
    @server.expects(:run_callbacks).with(:before_run)
    @server.expects(:run_callbacks).with(:after_run)
    @server.run ARGV, STDERR, STDOUT, :runner => @runner
  end

  # no idea how to test Process.fork, DRb.thread.join and stuff like that :/
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
adva-0.3.2 test/test_server/test/server_test.rb
adva-0.3.1 test/test_server/test/server_test.rb
adva-0.3.0 test/test_server/test/server_test.rb
adva-0.2.4 test/test_server/test/server_test.rb
adva-0.2.3 test/test_server/test/server_test.rb
adva-0.2.2 test/test_server/test/server_test.rb
adva-0.2.1 test/test_server/test/server_test.rb
adva-0.2.0 test/test_server/test/server_test.rb
adva-0.1.4 test/test_server/test/server_test.rb
adva-0.1.3 test/test_server/test/server_test.rb
adva-0.1.2 test/test_server/test/server_test.rb
adva-0.1.1 test/test_server/test/server_test.rb
adva-0.1.0 test/test_server/test/server_test.rb
adva-0.0.1 test/test_server/test/server_test.rb