lib/konacha/runner.rb in konacha-1.2.1 vs lib/konacha/runner.rb in konacha-1.2.2
- old
+ new
@@ -72,18 +72,22 @@
dots_printed = 0
begin
sleep 0.1
done, dots = session.evaluate_script('[Konacha.done, Konacha.dots]')
- io.write dots[dots_printed..-1]
- io.flush
- dots_printed = dots.length
+ if dots
+ io.write dots[dots_printed..-1]
+ io.flush
+ dots_printed = dots.length
+ end
end until done
@examples = JSON.parse(session.evaluate_script('Konacha.getResults()')).map do |row|
Example.new(row)
end
+ rescue => e
+ raise Konacha::Error, "Error communicating with browser process: #{e.inspect}"
end
end
class Example
def initialize(row)
@@ -101,7 +105,10 @@
msg << " #{@row['message']}"
msg << " in #{@row['trace']['fileName']}:#{@row['trace']['lineNumber']}" if @row['trace']
msg.join("\n")
end
end
+ end
+
+ class Error < StandardError
end
end