Skip to content

Commit 63664f2

Browse files
author
Andrei
committed
Merge pull request #186 from nicola/capital-tests
Avoid capital letters in tests
2 parents 6513eaf + ab540d0 commit 63664f2

4 files changed

Lines changed: 34 additions & 35 deletions

File tree

‎test/acl.js‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ describe('ACL HTTP', function () {
7575
return options
7676
}
7777

78-
describe('No ACL', function () {
78+
describe('no ACL', function () {
7979
it('should return 403 for any resource', function (done) {
8080
var options = createOptions('/acl/no-acl', 'user1')
8181
request(options, function (error, response, body) {
@@ -84,7 +84,7 @@ describe('ACL HTTP', function () {
8484
done()
8585
})
8686
})
87-
it('should have User in the Header', function (done) {
87+
it('should have `User` set in the Response Header', function (done) {
8888
var options = createOptions('/acl/no-acl', 'user1')
8989
request(options, function (error, response, body) {
9090
assert.equal(error, null)
@@ -177,7 +177,7 @@ describe('ACL HTTP', function () {
177177
done()
178178
})
179179
})
180-
it('Should return text/turtle for the acl file', function (done) {
180+
it('should return text/turtle for the acl file', function (done) {
181181
var options = createOptions('/acl/write-acl/.acl', 'user1')
182182
options.headers = {
183183
accept: 'text/turtle'
@@ -189,7 +189,7 @@ describe('ACL HTTP', function () {
189189
done()
190190
})
191191
})
192-
it('Should create test file', function (done) {
192+
it('should create test file', function (done) {
193193
var options = createOptions('/acl/write-acl/test-file', 'user1')
194194
options.headers = {
195195
'content-type': 'text/turtle'
@@ -201,7 +201,7 @@ describe('ACL HTTP', function () {
201201
done()
202202
})
203203
})
204-
it("Should create test file's acl file", function (done) {
204+
it("should create test file's acl file", function (done) {
205205
var options = createOptions('/acl/write-acl/test-file.acl', 'user1')
206206
options.headers = {
207207
'content-type': 'text/turtle'
@@ -213,7 +213,7 @@ describe('ACL HTTP', function () {
213213
done()
214214
})
215215
})
216-
it("Should access test file's acl file", function (done) {
216+
it("should access test file's acl file", function (done) {
217217
var options = createOptions('/acl/write-acl/test-file.acl', 'user1')
218218
options.headers = {
219219
accept: 'text/turtle'
@@ -241,7 +241,7 @@ describe('ACL HTTP', function () {
241241
rm('acl/origin/test-folder/.acl')
242242
})
243243

244-
it('Should PUT new ACL file', function (done) {
244+
it('should PUT new ACL file', function (done) {
245245
var options = createOptions('/acl/origin/test-folder/.acl', 'user1')
246246
options.headers = {
247247
'content-type': 'text/turtle'
@@ -361,7 +361,7 @@ describe('ACL HTTP', function () {
361361
done()
362362
})
363363
})
364-
it('Should create new ACL file', function (done) {
364+
it('should create new ACL file', function (done) {
365365
var options = createOptions(testDirAclFile, 'user1')
366366
options.headers = {
367367
'content-type': 'text/turtle'

‎test/formats.js‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('formats', function () {
88

99
var server = supertest(ldp)
1010
describe('HTML', function () {
11-
it('Should return HTML containing "Hello, World!" if Accept is set to text/html', function (done) {
11+
it('should return HTML containing "Hello, World!" if Accept is set to text/html', function (done) {
1212
server.get('/hello.html')
1313
.set('accept', 'application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5')
1414
.expect('Content-type', /text\/html/)
@@ -22,26 +22,26 @@ describe('formats', function () {
2222
// This would throw an error
2323
JSON.parse(res.text)
2424
}
25-
it('Should return JSON-LD document if Accept is set to only application/ld+json', function (done) {
25+
it('should return JSON-LD document if Accept is set to only application/ld+json', function (done) {
2626
server.get('/patch-5-initial.ttl')
2727
.set('accept', 'application/ld+json')
2828
.expect(200)
2929
.expect('content-type', /application\/ld\+json/)
3030
.end(done)
3131
})
32-
it('Should prefer to avoid translation even if type is listed with less priority', function (done) {
32+
it('should prefer to avoid translation even if type is listed with less priority', function (done) {
3333
server.get('/patch-5-initial.ttl')
3434
.set('accept', 'application/ld+json;q=0.9,text/turtle;q=0.8,text/plain;q=0.7,*/*;q=0.5')
3535
.expect('content-type', /text\/turtle/)
3636
.expect(200, done)
3737
})
38-
it('Should return JSON-LD document if Accept is set to application/ld+json and other types', function (done) {
38+
it('should return JSON-LD document if Accept is set to application/ld+json and other types', function (done) {
3939
server.get('/patch-5-initial.ttl')
4040
.set('accept', 'application/ld+json;q=0.9,application/rdf+xml;q=0.7')
4141
.expect('content-type', /application\/ld\+json/)
4242
.expect(200, done)
4343
})
44-
it('Should return valid JSON if Accept is set to JSON-LD', function (done) {
44+
it('should return valid JSON if Accept is set to JSON-LD', function (done) {
4545
server.get('/patch-5-initial.ttl')
4646
.set('accept', 'application/ld+json')
4747
.expect(isValidJSON)
@@ -50,7 +50,7 @@ describe('formats', function () {
5050
})
5151

5252
describe('N-Quads', function () {
53-
it('Should return N-Quads document is Accept is set to application/n-quads', function (done) {
53+
it('should return N-Quads document is Accept is set to application/n-quads', function (done) {
5454
server.get('/patch-5-initial.ttl')
5555
.set('accept', 'application/n-quads;q=0.9,application/ld+json;q=0.8,application/rdf+xml;q=0.7')
5656
.expect('content-type', /application\/n-quads/)
@@ -59,7 +59,7 @@ describe('formats', function () {
5959
})
6060

6161
describe('n3', function () {
62-
it('Should return turtle document if Accept is set to text/n3', function (done) {
62+
it('should return turtle document if Accept is set to text/n3', function (done) {
6363
server.get('/patch-5-initial.ttl')
6464
.set('accept', 'text/n3;q=0.9,application/n-quads;q=0.7,text/plain;q=0.7')
6565
.expect('content-type', /text\/n3/)
@@ -68,7 +68,7 @@ describe('formats', function () {
6868
})
6969

7070
describe('turtle', function () {
71-
it('Should return turtle document if Accept is set to turtle', function (done) {
71+
it('should return turtle document if Accept is set to turtle', function (done) {
7272
server.get('/patch-5-initial.ttl')
7373
.set('accept', 'text/turtle;q=0.9,application/rdf+xml;q=0.8,text/plain;q=0.7,*/*;q=0.5')
7474
.expect('content-type', /text\/turtle/)
@@ -77,7 +77,7 @@ describe('formats', function () {
7777
})
7878

7979
describe('none', function () {
80-
it('Should return turtle document if no Accept header is set', function (done) {
80+
it('should return turtle document if no Accept header is set', function (done) {
8181
server.get('/patch-5-initial.ttl')
8282
.expect('content-type', /text\/turtle/)
8383
.expect(200, done)

‎test/http.js‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ describe('HTTP APIs', function () {
5252
.expect(200, done)
5353
})
5454

55-
it('Should exists', function (done) {
55+
it('should exist', function (done) {
5656
server.get('/')
5757
.expect(200, done)
5858
})
59-
it('Should be a turtle file by default', function (done) {
59+
it('should be a turtle file by default', function (done) {
6060
server.get('/')
6161
.expect('content-type', /text\/turtle/)
6262
.expect(200, done)
@@ -186,7 +186,7 @@ describe('HTTP APIs', function () {
186186
.expect(200, done)
187187
})
188188

189-
it('Should return empty response body', function (done) {
189+
it('should return empty response body', function (done) {
190190
server.head('/patch-5-initial.ttl')
191191
.expect(emptyResponse)
192192
.expect(200, done)
@@ -223,13 +223,13 @@ describe('HTTP APIs', function () {
223223
var putRequestBody = fs.readFileSync(__dirname + '/resources/sampleContainer/put1.ttl', {
224224
'encoding': 'utf8'
225225
})
226-
it('Should create new resource', function (done) {
226+
it('should create new resource', function (done) {
227227
server.put('/put-resource-1.ttl')
228228
.send(putRequestBody)
229229
.set('content-type', 'text/turtle')
230230
.expect(201, done)
231231
})
232-
it('Should create directories if they do not exist', function (done) {
232+
it('should create directories if they do not exist', function (done) {
233233
server.put('/foo/bar/baz.ttl')
234234
.send(putRequestBody)
235235
.set('content-type', 'text/turtle')
@@ -242,19 +242,19 @@ describe('HTTP APIs', function () {
242242
})
243243
.expect(201, done)
244244
})
245-
it('Should return 409 code when trying to put to a container', function (done) {
245+
it('should return 409 code when trying to put to a container', function (done) {
246246
server.put('/')
247247
.expect(409, done)
248248
})
249249
})
250250

251251
describe('DELETE API', function () {
252-
it('Should return 404 status when deleting a file that does not exists',
252+
it('should return 404 status when deleting a file that does not exists',
253253
function (done) {
254254
server.delete('/false-file-48484848')
255255
.expect(404, done)
256256
})
257-
it('Should delete previously PUT file', function (done) {
257+
it('should delete previously PUT file', function (done) {
258258
server.delete('/put-resource-1.ttl')
259259
.expect(200, done)
260260
})
@@ -267,7 +267,7 @@ describe('HTTP APIs', function () {
267267
var postRequest2Body = fs.readFileSync(__dirname + '/resources/sampleContainer/post2.ttl', {
268268
'encoding': 'utf8'
269269
})
270-
it('Should create new resource', function (done) {
270+
it('should create new resource', function (done) {
271271
server.post('/')
272272
.send(postRequest1Body)
273273
.set('content-type', 'text/turtle')
@@ -277,7 +277,7 @@ describe('HTTP APIs', function () {
277277
.expect(hasHeader('acl', suffixAcl))
278278
.expect(201, done)
279279
})
280-
it('Should create new resource even if no trailing / is in the target', function (done) {
280+
it('should create new resource even if no trailing / is in the target', function (done) {
281281
rm('target.ttl')
282282
server.post('')
283283
.send(postRequest1Body)
@@ -291,7 +291,7 @@ describe('HTTP APIs', function () {
291291
return done(err)
292292
})
293293
})
294-
it('Should fail return 404 if no parent container found', function (done) {
294+
it('should fail return 404 if no parent container found', function (done) {
295295
rm('target.ttl')
296296
server.post('/hello.html/')
297297
.send(postRequest1Body)
@@ -302,42 +302,42 @@ describe('HTTP APIs', function () {
302302
return done(err)
303303
})
304304
})
305-
it('Should create a new slug if there is a resource with the same name', function (done) {
305+
it('should create a new slug if there is a resource with the same name', function (done) {
306306
server.post('/')
307307
.send(postRequest1Body)
308308
.set('content-type', 'text/turtle')
309309
.set('slug', 'post-resource-1.ttl')
310310
.expect(201, done)
311311
})
312-
it('Should be able to delete newly created resource', function (done) {
312+
it('should be able to delete newly created resource', function (done) {
313313
server.delete('/post-resource-1.ttl')
314314
.expect(200, done)
315315
})
316316
var postResourceName
317317
var setResourceName = function (res) {
318318
postResourceName = res.header.location
319319
}
320-
it('Should create new resource without slug header', function (done) {
320+
it('should create new resource without slug header', function (done) {
321321
server.post('/')
322322
.send(postRequest1Body)
323323
.set('content-type', 'text/turtle')
324324
.expect(201)
325325
.expect(setResourceName)
326326
.end(done)
327327
})
328-
it('Should be able to delete newly created resource', function (done) {
328+
it('should be able to delete newly created resource', function (done) {
329329
server.delete('/' + postResourceName.replace(/https?\:\/\/127.0.0.1:[0-9]*\//, ''))
330330
.expect(200, done)
331331
})
332-
it('Should create container', function (done) {
332+
it('should create container', function (done) {
333333
server.post('/')
334334
.set('content-type', 'text/turtle')
335335
.set('slug', 'loans')
336336
.set('link', '<http://www.w3.org/ns/ldp#BasicContainer>; rel="type"')
337337
.send(postRequest2Body)
338338
.expect(201, done)
339339
})
340-
it('Should be able to access container', function (done) {
340+
it('should be able to access container', function (done) {
341341
server.get('/loans')
342342
.expect('content-type', /text\/turtle/)
343343
.expect(function () {

‎test/utils.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ describe('Utility functions', function () {
1919
it('should return empty as relative path for undefined path', function () {
2020
assert.equal(utils.pathBasename(undefined), '')
2121
})
22-
2322
it('should properly decode a uri', function () {
2423
assert.equal(utils.uriToFilename('uri%20', 'base/'), 'base/uri ')
2524
})

0 commit comments

Comments
 (0)