From d4683ca485474e8bff076f9282a2c55570db5dba Mon Sep 17 00:00:00 2001 From: Christian Williams Date: Mon, 28 Dec 2009 16:46:50 -0600 Subject: [PATCH] Refactor. --- lib/jasmine/config.rb | 4 +++- spec/jasmine_self_test_spec.rb | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/jasmine/config.rb b/lib/jasmine/config.rb index d07be03..73aac30 100644 --- a/lib/jasmine/config.rb +++ b/lib/jasmine/config.rb @@ -29,6 +29,8 @@ module Jasmine @jasmine_server_port = Jasmine::find_unused_port @selenium_server_port = Jasmine::find_unused_port + server = Jasmine::Server.new(@jasmine_server_port, self) + @selenium_pid = fork do Process.setpgrp exec "java -jar #{@selenium_jar_path} -port #{@selenium_server_port} > /dev/null 2>&1" @@ -37,7 +39,7 @@ module Jasmine @jasmine_server_pid = fork do Process.setpgrp - Jasmine::Server.start(@jasmine_server_port, spec_files, @options) + server.start exit! 0 end puts "jasmine server started. pid is #{@jasmine_server_pid}" diff --git a/spec/jasmine_self_test_spec.rb b/spec/jasmine_self_test_spec.rb index fcb604e..e66c32e 100644 --- a/spec/jasmine_self_test_spec.rb +++ b/spec/jasmine_self_test_spec.rb @@ -2,8 +2,8 @@ require File.expand_path(File.join(File.dirname(__FILE__), "spec_helper")) require 'jasmine_self_test_config' -jasmine_runner = JasmineSelfTestConfig.new -spec_builder = Jasmine::SpecBuilder.new(jasmine_runner) +jasmine_config = JasmineSelfTestConfig.new +spec_builder = Jasmine::SpecBuilder.new(jasmine_config) should_stop = false