 touch = require 'touch'
 date = require 'date-utils'
 mkdirp = require 'mkdirp'
+moment = require 'moment'
 log = require('printit')
     prefix: "Tests"
 

                        docType: 'Binary'
                        checksum: sum
                        path: 'chat-mignon.jpg'
                    pouch.db.put binaryDoc, (err) ->
                        pouch.binaries.get sum, (err, binaryDoc) ->
                            should.not.exist err

                            operationQueue.createFileLocally doc, (err) ->
                                should.not.exist err
                                done()

            it 'creates parent Folder', ->

            it 'copy the local file', ->
            it 'update creation and last modification dates', ->

        describe 'Similar File exists remotely', ->

            it 'creates parent Folder', ->
            it 'copy the local file', ->
            it 'update creation and last modification dates', ->

                should.exist err
                done()

        describe 'Similar file exists locally', ->
            fileRelativePath = '../fixtures/chat-mignon.jpg'
            fixturePath = path.resolve __dirname, fileRelativePath
            folderPath = path.join syncPath, 'dossier-1'
            filePath = path.join syncPath, 'dossier-1', 'chat-mignon.jpg'
            creationDate = moment().days(-6)
            lastModification = moment().days(-4)

            before (done) ->
                fs.copySync fixturePath, path.join(syncPath, 'chat-mignon.jpg')
                filesystem.checksum fixturePath, (err, sum) =>
                    @sum = sum
                    should.not.exist err

                    doc =
                        path: "dossier-1"
                        name: "chat-mignon.jpg"
                        creationDate: creationDate
                        lastModification: lastModification
                        binary:
                            file:
                                checksum: sum
