2 * prompt-test.js: Tests for prompt.
4 * (C) 2010, Nodejitsu Inc.
8 var assert = require('assert'),
9 vows = require('vows'),
10 prompt = require('../lib/prompt'),
11 winston = require('winston').cli(),
12 helpers = require('./helpers');
14 vows.describe('prompt/interactive').addBatch({
15 "When using prompt": {
18 // Reset the prompt for interactive testing
20 prompt.started = false;
22 winston.info('These prompt tests are interactive');
23 winston.info('Not following instructions will result in test failure');
26 "the getInput() method": {
27 "when passed a complex property with `hidden: true`": {
29 winston.info('When prompted, enter: 12345 [backspace] [backspace] [enter]');
30 prompt.getInput(helpers.properties.password, this.callback);
32 "should respond with `123`": function (err, result) {
34 assert.equal(result, '123');