1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | "use strict";
|
9 |
|
10 | var assert = require("assert");
|
11 | var jsDAV = require("./../lib/jsdav");
|
12 | var jsDAV_Codesearch_Plugin = require("./../lib/DAV/plugins/codesearch");
|
13 |
|
14 | module.exports = {
|
15 | timeout: 30000,
|
16 |
|
17 | setUpSuite: function(next) {
|
18 | this.plugin = jsDAV_Codesearch_Plugin.new({
|
19 | addEventListener: function() {}
|
20 | });
|
21 | next();
|
22 | },
|
23 |
|
24 | tearDownSuite: function(next) {
|
25 | next();
|
26 | },
|
27 |
|
28 | "test retrieving a string": function(next) {
|
29 | var all = '';
|
30 | this.plugin.doCodesearch({path: __dirname}, {query: "tearDown", pattern: "*.*", uri: "http://bla/"}, function(out){
|
31 | all += out;
|
32 | }, function(err, out) {
|
33 | all += out;
|
34 | assert.ok(all.indexOf("tearDown") > -1);
|
35 |
|
36 | next();
|
37 | });
|
38 | }
|
39 | };
|
40 |
|
41 | process.on("exit", function() {
|
42 | if (module.exports.conn)
|
43 | module.exports.conn.end();
|
44 | });
|
45 |
|
46 | !module.parent && require("../../../node_modules/asyncjs/lib/test").testcase(module.exports).exec();
|