Permalink
Browse files

[test] Test that --no-colors strips colors from output.

  • Loading branch information...
1 parent 2c90b25 commit 698c0522a4f85b38778c245e0404f4828ec767a7 @jfhbrook jfhbrook committed Feb 28, 2012
Showing with 35 additions and 0 deletions.
  1. +35 −0 test/commands/no-colors-test.js
@@ -0,0 +1,35 @@
+/*
+ * env.js: Tests for `jitsu env *` command(s).
+ *
+ * (C) 2010, Nodejitsu Inc.
+ *
+ */
+
+var assert = require('assert'),
+ vows = require('vows'),
+ colors = require('colors'),
+ spawn = require('child_process').spawn;
+
+vows.describe('jitsu/commands/users').addBatch({
+ 'when using the --no-colors flag': {
+ topic: function () {
+ var jitsu = spawn('jitsu', [ '--no-colors' ]),
+ text = '',
+ callback = this.callback;
+
+
+
+ jitsu.stdout.on('data', function (data) {
+ text += data.toString();
+ });
+
+ jitsu.on('exit', function () {
+ callback(null, text);
+ });
+
+ },
+ 'output does not contain ansi codes': function (text) {
+ assert.equal(text, colors.stripColors(text));
+ }
+ }
+}).export(module);

0 comments on commit 698c052

Please sign in to comment.