From ca6b23684e6592114a82ecc5c446541fafba6f1c Mon Sep 17 00:00:00 2001 From: Christian Williams & Kim Eric Mittler Date: Wed, 2 Sep 2009 12:36:51 -0700 Subject: [PATCH] Time out if we can't load suite info within 60 seconds. --- contrib/ruby/jasmine_spec_builder.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/ruby/jasmine_spec_builder.rb b/contrib/ruby/jasmine_spec_builder.rb index 6e03801..4a6e902 100644 --- a/contrib/ruby/jasmine_spec_builder.rb +++ b/contrib/ruby/jasmine_spec_builder.rb @@ -51,7 +51,9 @@ module Jasmine end def load_suite_info - while !eval_js('jsApiReporter.started') do + started = Time.now + while !eval_js('jsApiReporter && jsApiReporter.started') do + raise "couldn't connect to Jasmine after 60 seconds" if (started + 60 < Time.now) sleep 0.1 end