Fix printing of jasmine.log() messages.

This commit is contained in:
Christian Williams 2009-07-21 12:31:16 -07:00
parent 8fb59d391c
commit 5ae68b8c3b

View File

@ -109,13 +109,22 @@ module Jasmine
out = "" out = ""
messages = spec_results['messages'].each do |message| messages = spec_results['messages'].each do |message|
case
when message["type"] == "MessageResult"
puts message["text"]
puts "\n"
else
STDERR << message["message"]
STDERR << "\n"
out << message["message"] out << message["message"]
out << "\n" out << "\n"
unless message["passed"] unless message["passed"]
stack_trace = message["trace"]["stack"] stack_trace = message["trace"]["stack"]
out << stack_trace.gsub(/\(.*\)@http:\/\/localhost:[0-9]+\/specs\//, "/spec/") STDERR << stack_trace.gsub(/\(.*\)@http:\/\/localhost:[0-9]+\/specs\//, "/spec/")
out << "\n" STDERR << "\n"
end
end end
end end