Permalink
Browse files

add print function to replace deprecated util.print

  • Loading branch information...
1 parent 5e786a2 commit 382fd744b4e454e28852351691c836214f10c33d @nrstott nrstott committed Dec 10, 2013
Showing with 9 additions and 5 deletions.
  1. +2 −2 lib/jasmine-node/cli.js
  2. +6 −2 lib/jasmine-node/index.js
  3. +1 −1 lib/jasmine-node/reporter.js
View
4 lib/jasmine-node/cli.js
@@ -197,7 +197,7 @@ function onExit() {
}
var onComplete = function(runner, log) {
- util.print('\n');
+ process.stdout.write('\n');
if (runner.results().failedCount == 0) {
exitCode = 0;
} else {
@@ -241,7 +241,7 @@ jasmine.executeSpecsInFolder(options);
function help(){
- util.print([
+ process.stdout.write([
'USAGE: jasmine-node [--color|--noColor] [--verbose] [--coffee] directory'
, ''
, 'Options:'
View
8 lib/jasmine-node/index.js
@@ -117,12 +117,12 @@ jasmine.executeSpecsInFolder = function(options){
if(teamcity){
jasmineEnv.addReporter(new jasmine.TeamcityReporter());
} else if(isVerbose) {
- jasmineEnv.addReporter(new jasmine.TerminalVerboseReporter({ print: util.print,
+ jasmineEnv.addReporter(new jasmine.TerminalVerboseReporter({ print: print,
color: showColors,
onComplete: done,
stackFilter: removeJasmineFrames}));
} else {
- jasmineEnv.addReporter(new jasmine.TerminalReporter({print: util.print,
+ jasmineEnv.addReporter(new jasmine.TerminalReporter({print: print,
color: showColors,
includeStackTrace: includeStackTrace,
onComplete: done,
@@ -186,6 +186,10 @@ jasmine.asyncSpecDone = function(){
jasmine.asyncSpecWait.done = true;
};
+function print(str) {
+ process.stdout.write(util.format(str));
+}
+
for ( var key in jasmine) {
exports[key] = jasmine[key];
}
View
2 lib/jasmine-node/reporter.js
@@ -17,7 +17,7 @@
jasmineNode.TerminalReporter = function(config) {
- this.print_ = config.print || util.print;
+ this.print_ = config.print || function (str) { process.stdout.write(util.format(str)); };
this.color_ = config.color ? this.ANSIColors : this.NoColors;
this.started_ = false;

0 comments on commit 382fd74

Please sign in to comment.