diff --git a/test/basic.js b/test/basic.js index 5307829..6fab1e6 100644 --- a/test/basic.js +++ b/test/basic.js @@ -1,11 +1,12 @@ -var fs = require('fs') -var Protocol = require('bittorrent-protocol') -var ut_metadata = require('../') var bencode = require('bencode') +var fs = require('fs') +var path = require('path') +var Protocol = require('bittorrent-protocol') var test = require('tape') +var ut_metadata = require('../') // Used in multiple tests -var metadata = fs.readFileSync(__dirname + '/torrents/leaves-magnet.torrent') +var metadata = fs.readFileSync(path.join(__dirname, 'torrents/leaves-magnet.torrent')) test('wire.use(ut_metadata())', function (t) { var wire = new Protocol() diff --git a/test/fetch.js b/test/fetch.js index 50a57bf..0ab9602 100644 --- a/test/fetch.js +++ b/test/fetch.js @@ -1,15 +1,16 @@ +var bencode = require('bencode') var fs = require('fs') var parseTorrent = require('parse-torrent') +var path = require('path') var Protocol = require('bittorrent-protocol') -var ut_metadata = require('../') -var bencode = require('bencode') var test = require('tape') +var ut_metadata = require('../') // Used in multiple tests -var metadata = fs.readFileSync(__dirname + '/torrents/leaves-magnet.torrent') +var metadata = fs.readFileSync(path.join(__dirname, 'torrents/leaves-magnet.torrent')) var parsedTorrent = parseTorrent(metadata) -var largeMetadata = fs.readFileSync(__dirname + '/torrents/ubuntu-12.04.4-alternate-amd64.iso.torrent') +var largeMetadata = fs.readFileSync(path.join(__dirname, 'torrents/ubuntu-12.04.4-alternate-amd64.iso.torrent')) var largeParsedTorrent = parseTorrent(largeMetadata) var id1 = new Buffer('01234567890123456789')