Permalink
Browse files

Merge branch 'venturehacks-master'

  • Loading branch information...
2 parents 654b179 + e459efd commit 0eeac3a66a655343aa27aebd6371078d165b8dff @xian xian committed Nov 5, 2010
Showing with 13 additions and 1 deletion.
  1. +4 −0 lib/jasmine/config.rb
  2. +4 −0 lib/jasmine/selenium_driver.rb
  3. +5 −1 lib/jasmine/spec_builder.rb
View
@@ -76,6 +76,10 @@ def eval_js(script)
@client.eval_js(script)
end
+ def json_generate(obj)
+ @client.json_generate(obj)
+ end
+
def match_files(dir, patterns)
dir = File.expand_path(dir)
patterns.collect do |pattern|
@@ -41,5 +41,9 @@ def eval_js(script)
result = @driver.get_eval("try { eval(#{escaped_script}, window); } catch(err) { window.eval(#{escaped_script}); }")
JSON.parse("{\"result\":#{result}}")["result"]
end
+
+ def json_generate(obj)
+ JSON.generate(obj)
+ end
end
end
@@ -69,7 +69,7 @@ def results_for(spec_id)
def load_results
@spec_results = {}
@spec_ids.each_slice(50) do |slice|
- @spec_results.merge!(eval_js("var result = jsApiReporter.resultsForSpecs(#{JSON.generate(slice)}); if (window.Prototype && Object.toJSON) { Object.toJSON(result) } else { JSON.stringify(result) }"))
+ @spec_results.merge!(eval_js("var result = jsApiReporter.resultsForSpecs(#{json_generate(slice)}); if (window.Prototype && Object.toJSON) { Object.toJSON(result) } else { JSON.stringify(result) }"))
end
@spec_results
end
@@ -148,5 +148,9 @@ def report_spec(spec_id)
def eval_js(js)
@runner.eval_js(js)
end
+
+ def json_generate(obj)
+ @runner.json_generate(obj)
+ end
end
end

0 comments on commit 0eeac3a

Please sign in to comment.