Sha256: 6b10d510912ce84f530fc21bfc4aee7390e170173e565b3a108ca5377bbd6203

Contents?: true

Size: 787 Bytes

Versions: 3

Compression:

Stored size: 787 Bytes

Contents

require "#{File.dirname(__FILE__)}/../test_helper"
require 'open-uri'

# Start the server

class ServerTest < Test::Unit::TestCase

  PORT = 43040
  URL = "http://localhost:#{PORT}/"

  def setup
    @pid = Process.fork do
       Dir.chdir RAILS_ROOT do
         print "S"
         exec("script/server -p #{PORT} &> /dev/null")
       end
     end
     sleep(5)
  end
  
  def teardown
    # Process.kill(9, @pid) doesn't work because Mongrel has double-forked itself away
    `ps awx | grep #{PORT} | grep -v grep | awk '{print $1}'`.split("\n").each do |pid|
      system("kill -9 #{pid}")
      print "K"
    end
    sleep(2)
    @pid = nil
  end
  
  def test_association_reloading
    4.times do
      assert_match(/Sellers: index/, open(URL + 'sellers').read)
    end
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ultrasphinx-1.6.7 test/integration/server_test.rb
ultrasphinx-1.5.3 test/integration/server_test.rb
ultrasphinx-1.6 test/integration/server_test.rb