@@ -14,7 +14,7 @@ const rm = require('./../utils').rm
1414// this write function destroys
1515// the flexibility of this test unit
1616// highly recommend removing it
17- const write = require ( './../utils' ) . write
17+ // const write = require('./../utils').write
1818// var cp = require('./utils').cp
1919const read = require ( './../utils' ) . read
2020const fs = require ( 'fs' )
@@ -351,7 +351,7 @@ describe('LDP', function () {
351351 } )
352352 } )
353353
354- describe . skip ( 'listContainer' , function ( ) {
354+ describe ( 'listContainer' , function ( ) {
355355 /*
356356 it('should inherit type if file is .ttl', function (done) {
357357 write('@prefix dcterms: <http://purl.org/dc/terms/>.' +
@@ -391,35 +391,32 @@ describe('LDP', function () {
391391 })
392392*/
393393 it ( 'should not inherit type of BasicContainer/Container if type is File' , ( ) => {
394- write ( '@prefix dcterms: <http://purl.org/dc/terms/>.' +
395- '@prefix o: <http://example.org/ontology>.' +
396- '<> a <http://www.w3.org/ns/ldp#Container> ;' +
397- ' dcterms:title "This is a container" ;' +
398- ' o:limit 500000.00 .' , 'sampleContainer/containerFile.ttl' )
399-
400- write ( '@prefix dcterms: <http://purl.org/dc/terms/>.' +
401- '@prefix o: <http://example.org/ontology>.' +
402- '<> a <http://www.w3.org/ns/ldp#BasicContainer> ;' +
403- ' dcterms:title "This is a container" ;' +
404- ' o:limit 500000.00 .' , 'sampleContainer/basicContainerFile.ttl' )
405-
406- return ldp . listContainer ( path . join ( __dirname , '../resources/sampleContainer/' ) , 'https://server.tld/resources/sampleContainer/' , '' , 'server.tld' )
394+ const containerFileData = `'@prefix dcterms: <http://purl.org/dc/terms/>.' +
395+ '@prefix o: <http://example.org/ontology>.' +
396+ '<> a <http://www.w3.org/ns/ldp#Container> ;' +
397+ ' dcterms:title "This is a container" ;' +
398+ ' o:limit 500000.00 .'`
399+ fs . writeFileSync ( path . join ( root , '/resources/sampleContainer/containerFile.ttl' ) , containerFileData )
400+ const basicContainerFileData = `'@prefix dcterms: <http://purl.org/dc/terms/>.' +
401+ '@prefix o: <http://example.org/ontology>.' +
402+ '<> a <http://www.w3.org/ns/ldp#BasicContainer> ;' +
403+ ' dcterms:title "This is a container" ;' +
404+ ' o:limit 500000.00 .'`
405+ fs . writeFileSync ( path . join ( root , '/resources/sampleContainer/basicContainerFile.ttl' ) , basicContainerFileData )
406+
407+ return ldp . listContainer ( path . join ( root , '/resources/sampleContainer/' ) , 'https://server.tld/resources/sampleContainer/' , '' , 'server.tld' )
407408 . then ( data => {
408409 const graph = $rdf . graph ( )
409410 $rdf . parse (
410411 data ,
411412 graph ,
412413 'https://localhost:8443/resources/sampleContainer' ,
413414 'text/turtle' )
414-
415- const basicContainerStatements = graph
416- . each (
417- $rdf . sym ( 'https://localhost:8443/resources/sampleContainer/basicContainerFile.ttl' ) ,
418- ns . rdf ( 'type' ) ,
419- undefined
420- )
421- . map ( d => { return d . uri } )
422-
415+ const basicContainerStatements = graph . each (
416+ $rdf . sym ( 'https://localhost:8443/resources/sampleContainer/basicContainerFile.ttl' ) ,
417+ ns . rdf ( 'type' ) ,
418+ null
419+ ) . map ( d => { return d . uri } )
423420 const expectedStatements = [
424421 'http://www.w3.org/ns/iana/media-types/text/turtle#Resource' ,
425422 'http://www.w3.org/ns/ldp#Resource'
@@ -433,7 +430,6 @@ describe('LDP', function () {
433430 undefined
434431 )
435432 . map ( d => { return d . uri } )
436-
437433 assert . deepEqual ( containerStatements . sort ( ) , expectedStatements )
438434
439435 rm ( 'sampleContainer/containerFile.ttl' )
0 commit comments