require 'spec' require 'open-uri' require File.dirname(__FILE__) + '/jasmine_runner' describe Jasmine::SimpleServer do before do @port = Jasmine::find_unused_port end after do Process.kill "TERM", -@jasmine_server_pid if @jasmine_server_pid end it "should start and print script tags" do @jasmine_server_pid = fork do Process.setpgrp Jasmine::SimpleServer.start(@port, ["file1", "file2"], {}) exit! 0 end Jasmine::Runner.new(nil, nil, nil).wait_for_listener(@port) run_html = open("http://localhost:#{@port}/run.html").read run_html.should =~ /