Updated ruby contrib so that CI task now compatible with Prototype

This commit is contained in:
ragaskar
2010-01-23 13:50:44 -08:00
parent d72b18c47b
commit db1c6e659d
19 changed files with 20 additions and 20 deletions

View File

@@ -58,7 +58,7 @@ module Jasmine
sleep 0.1
end
@suites = eval_js('JSON.stringify(jsApiReporter.suites())')
@suites = eval_js("var result = jsApiReporter.suites(); if (window.Prototype && result && result.toJSON) { result.toJSON()} else { JSON.stringify(result) }")
end
def results_for(spec_id)
@@ -69,7 +69,7 @@ module Jasmine
def load_results
@spec_results = {}
@spec_ids.each_slice(50) do |slice|
@spec_results.merge!(eval_js("JSON.stringify(jsApiReporter.resultsForSpecs(#{JSON.generate(slice)}))"))
@spec_results.merge!(eval_js("var result = jsApiReporter.resultsForSpecs(#{JSON.generate(slice)}); if (window.Prototype && result && result.toJSON) { result.toJSON()} else { JSON.stringify(result) }"))
end
@spec_results
end