Export 0.2.1
[platform/framework/web/web-ui-fw.git] / libs / js / jquery-mobile-1.2.0 / node_modules / grunt / node_modules / prompt / test / interactive-prompt-test.js
1 /*
2  * prompt-test.js: Tests for prompt.  
3  *
4  * (C) 2010, Nodejitsu Inc.
5  *
6  */
7  
8 var assert = require('assert'),
9     vows = require('vows'),
10     prompt = require('../lib/prompt'),
11     winston = require('winston').cli(),
12     helpers = require('./helpers');
13
14 vows.describe('prompt/interactive').addBatch({
15   "When using prompt": {
16     topic: function () {
17       //
18       // Reset the prompt for interactive testing
19       //
20       prompt.started = false;
21       prompt.start();
22       winston.info('These prompt tests are interactive');
23       winston.info('Not following instructions will result in test failure');
24       return null;
25     },
26     "the getInput() method": {
27       "when passed a complex property with `hidden: true`": {
28         topic: function () {
29           winston.info('When prompted, enter: 12345 [backspace] [backspace] [enter]');
30           prompt.getInput(helpers.properties.password, this.callback);
31         },
32         "should respond with `123`": function (err, result) {
33           assert.isNull(err);
34           assert.equal(result, '123');
35         }
36       }
37     }
38   }
39 }).export(module);