UNPKG

1.24 kBJavaScriptView Raw
1/*
2 * @package jsDAV
3 * @subpackage DAV
4 * @copyright Copyright(c) 2011 Ajax.org B.V. <info AT ajax.org>
5 * @author Ruben Daniels <ruben AT c9 DOT io>
6 * @license http://github.com/mikedeboer/jsDAV/blob/master/LICENSE MIT License
7 */
8"use strict";
9
10var assert = require("assert");
11var jsDAV = require("./../lib/jsdav");
12var jsDAV_Codesearch_Plugin = require("./../lib/DAV/plugins/codesearch");
13
14module.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
41process.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();