Skip to content

Commit 01a2324

Browse files
committed
minor test changes, jscs rule update
1 parent 5f08d23 commit 01a2324

File tree

3 files changed

+18
-19
lines changed

3 files changed

+18
-19
lines changed

.jscs.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
"requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"],
33
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"],
44

5+
"requireSpaceBeforeKeywords": [
6+
"else",
7+
"while",
8+
"catch"
9+
],
10+
511
"requireSpaceBeforeBinaryOperators": ["?", "+", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
612
"requireSpaceAfterBinaryOperators": ["?", "+", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
713
"disallowSpaceAfterBinaryOperators": ["!"],

lib/multi_caching.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var multi_caching = function(caches) {
3434
};
3535
if (typeof options === 'object') {
3636
cache.store.get(key, options, callback);
37-
}else {
37+
} else {
3838
cache.store.get(key, callback);
3939
}
4040
}, cb);
@@ -183,7 +183,7 @@ var multi_caching = function(caches) {
183183
async.forEach(caches, function(cache, async_cb) {
184184
if (typeof options === 'object') {
185185
cache.store.del(key, options, async_cb);
186-
}else {
186+
} else {
187187
cache.store.del(key, async_cb);
188188
}
189189
}, cb);

test/stores/options.unit.js

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,16 @@ var testStore = function(args) {
8585
};
8686

8787
describe("Methods with options", function() {
88+
var testInstance = caching.caching({store: testStore()});
89+
var testCache;
90+
8891
before(function() {
8992
key = support.random.string(20);
9093
value = support.random.string(20);
94+
testCache = caching.multi_caching([testInstance]);
9195
});
92-
describe("get with options", function() {
93-
var testInstance = caching.caching({store: testStore()});
94-
var testCache;
95-
before(function() {
96-
testCache = caching.multi_caching([testInstance]);
97-
});
9896

97+
describe("get with options", function() {
9998
it("lets us pass options by value", function(done) {
10099
var options = {value: value};
101100
testCache.get(key, options, function(err, response) {
@@ -116,13 +115,9 @@ describe("Methods with options", function() {
116115
});
117116
});
118117
});
118+
119119
describe("set with options", function() {
120-
var testInstance = caching.caching({store: testStore()});
121-
var testCache;
122120
var ttl = 60;
123-
before(function() {
124-
testCache = caching.multi_caching([testInstance]);
125-
});
126121

127122
it("lets us pass options by value", function(done) {
128123
var options = {ttl: ttl, value: value};
@@ -143,13 +138,8 @@ describe("Methods with options", function() {
143138
testCache.set(key, value, options, function() {}, options);
144139
});
145140
});
146-
describe("delete with options", function() {
147-
var testInstance = caching.caching({store: testStore()});
148-
var testCache;
149-
before(function() {
150-
testCache = caching.multi_caching([testInstance]);
151-
});
152141

142+
describe("delete with options", function() {
153143
it("lets us pass options by value", function(done) {
154144
var options = {value: value};
155145
testCache.del(key, options, function() {
@@ -169,12 +159,14 @@ describe("Methods with options", function() {
169159
});
170160
});
171161
});
162+
172163
describe("Multiple stores with options", function() {
173164
var testInstance = caching.caching({store: testStore()});
174165
var memInstance = caching.caching({store: "memory"});
175166
var testCache;
176167
var options = {runNormal: true};
177168
var ttl = 1;
169+
178170
before(function() {
179171
key = support.random.string(20);
180172
value = support.random.string(20);
@@ -197,6 +189,7 @@ describe("Multiple stores with options", function() {
197189
});
198190
});
199191
});
192+
200193
it("lets us not pass options which only one store uses", function() {
201194
testCache.set(key, value, ttl, function(err) {
202195
check_err(err);

0 commit comments

Comments
 (0)