use the jasmine pretty printer if available

This commit is contained in:
John Bintz 2011-06-07 14:55:31 -04:00
parent b06fb6f101
commit 0426fc57cc
4 changed files with 12 additions and 1 deletions

View File

@ -8,5 +8,6 @@ gem 'fakefs', :require => nil
gem 'guard' gem 'guard'
gem 'guard-rspec' gem 'guard-rspec'
gem 'guard-shell' gem 'guard-shell'
gem 'guard-coffeescript'
gem 'growl' gem 'growl'
gem 'rake', '0.8.7' gem 'rake', '0.8.7'

View File

@ -21,3 +21,5 @@ def compile
end end
compile compile
guard 'coffeescript', :input => 'jasmine'

View File

@ -221,6 +221,8 @@ void HeadlessSpecRunner::log(const QString &msg)
} }
std::cout << "[console] "; std::cout << "[console] ";
clear(); clear();
if (msg.contains("\n"))
std::cout << std::endl;
std::cout << qPrintable(msg); std::cout << qPrintable(msg);
std::cout << std::endl; std::cout << std::endl;
} }

View File

@ -36,7 +36,13 @@ module Jasmine
<head> <head>
<title>Jasmine Test Runner</title> <title>Jasmine Test Runner</title>
<script type="text/javascript"> <script type="text/javascript">
window.console = { log: function(data) { JHW.log(JSON.stringify(data)); } }; window.console = { log: function(data) {
if (jasmine) {
JHW.log(jasmine.pp(data))
} else {
JHW.log(JSON.stringify(data));
}
} };
</script> </script>
#{files.join("\n")} #{files.join("\n")}
</head> </head>