Report spec results properly.

This commit is contained in:
Christian Williams & Aaron Peckham
2009-07-10 14:35:24 -07:00
parent 286fc25aab
commit 5b695d3deb
6 changed files with 150 additions and 14 deletions
+3 -2
View File
@@ -29,7 +29,7 @@ module Jasmine
class SimpleServer
def self.start(port, spec_dir, mappings)
require "thin"
require 'thin'
config = {
'/run.html' => Jasmine::RunAdapter.new(spec_dir)
@@ -83,7 +83,8 @@ module Jasmine
def eval_js(script)
escaped_script = "'" + script.gsub(/(['\\])/) { '\\' + $1 } + "'"
@driver.get_eval("window.eval(#{escaped_script})")
result = @driver.get_eval("window.eval(#{escaped_script})")
JSON.parse("[#{result}]")[0]
end
end