Skip to content

Commit 77b58ce

Browse files
committed
removed: global module
1 parent f8b8893 commit 77b58ce

2 files changed

Lines changed: 74 additions & 74 deletions

File tree

test/definitions/initialize.js

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
var assert = require('assert');
2+
3+
framework.onMeta = function(a,b) {
4+
return a + b;
5+
};
6+
7+
framework.onSettings = function(a,b) {
8+
return a + b;
9+
};
10+
11+
framework.onPictureDimension = function(dimension) {
12+
13+
switch(dimension) {
14+
case 'small':
15+
return { width: 128, height: 96 };
16+
case 'middle':
17+
return { width: 320, height: 240 };
18+
}
19+
20+
return null;
21+
};
22+
23+
framework.on('load', function() {
24+
var self = this;
25+
26+
self.log = function(value) {
27+
assert.ok(value === 'test', 'framework: log()');
28+
return self;
29+
};
30+
31+
self.helpers.property = 'OK';
32+
self.helpers.fn = function(a) {
33+
return a;
34+
};
35+
36+
self.global.header = 0;
37+
self.global.middleware = 0;
38+
self.global.timeout = 0;
39+
self.global.file = 0;
40+
self.global.all = 0;
41+
42+
/*
43+
REMOVED
44+
self.middleware(function(next) {
45+
self.global.header++;
46+
next();
47+
});
48+
*/
49+
self.middleware('each', function(req, res, next) {
50+
self.global.all++;
51+
next();
52+
});
53+
54+
self.middleware('middleware', function(req, res, next) {
55+
self.global.middleware++;
56+
next();
57+
});
58+
59+
self.middleware('file', function(req, res, next) {
60+
self.global.file++;
61+
assert.ok(req.isStaticFile === true, 'file middleware problem');
62+
next();
63+
});
64+
65+
self.use('each');
66+
});
67+
68+
framework.onPictureUrl = function(dimension, id, width, height, alt) {
69+
return dimension + '-' + id + '.jpg';
70+
};
71+
72+
framework.onValidation = function(name, value) {
73+
return name + value;
74+
};

test/modules/#.js

Lines changed: 0 additions & 74 deletions
This file was deleted.

0 commit comments

Comments
 (0)