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|
out << message["message"] case
out << "\n" when message["type"] == "MessageResult"
puts message["text"]
puts "\n"
else
STDERR << message["message"]
STDERR << "\n"
unless message["passed"] out << message["message"]
stack_trace = message["trace"]["stack"] out << "\n"
out << stack_trace.gsub(/\(.*\)@http:\/\/localhost:[0-9]+\/specs\//, "/spec/")
out << "\n" unless message["passed"]
stack_trace = message["trace"]["stack"]
STDERR << stack_trace.gsub(/\(.*\)@http:\/\/localhost:[0-9]+\/specs\//, "/spec/")
STDERR << "\n"
end
end end
end end