diff --git a/test/client-large-torrent.js b/test/client-large-torrent.js index a241fe3..6bfe189 100644 --- a/test/client-large-torrent.js +++ b/test/client-large-torrent.js @@ -1,10 +1,11 @@ var Client = require('../') var fs = require('fs') var parseTorrent = require('parse-torrent') +var path = require('path') var Server = require('../').Server var test = require('tape') -var torrent = fs.readFileSync(__dirname + '/torrents/sintel-5gb.torrent') +var torrent = fs.readFileSync(path.join(__dirname, 'torrents/sintel-5gb.torrent')) var parsedTorrent = parseTorrent(torrent) var peerId = new Buffer('01234567890123456789') diff --git a/test/client.js b/test/client.js index 6a1dbf5..364aaaa 100644 --- a/test/client.js +++ b/test/client.js @@ -2,9 +2,10 @@ var Client = require('../') var common = require('./common') var fs = require('fs') var parseTorrent = require('parse-torrent') +var path = require('path') var test = require('tape') -var torrent = fs.readFileSync(__dirname + '/torrents/bitlove-intro.torrent') +var torrent = fs.readFileSync(path.join(__dirname, 'torrents/bitlove-intro.torrent')) var parsedTorrent = parseTorrent(torrent) var peerId1 = new Buffer('01234567890123456789') var peerId2 = new Buffer('12345678901234567890') diff --git a/test/filter.js b/test/filter.js index a8da880..6bff338 100644 --- a/test/filter.js +++ b/test/filter.js @@ -1,13 +1,14 @@ var Client = require('../') var fs = require('fs') var parseTorrent = require('parse-torrent') +var path = require('path') var Server = require('../').Server var test = require('tape') -var bitlove = fs.readFileSync(__dirname + '/torrents/bitlove-intro.torrent') +var bitlove = fs.readFileSync(path.join(__dirname, 'torrents/bitlove-intro.torrent')) var parsedBitlove = parseTorrent(bitlove) -var leaves = fs.readFileSync(__dirname + '/torrents/leaves.torrent') +var leaves = fs.readFileSync(path.join(__dirname, 'torrents/leaves.torrent')) var parsedLeaves = parseTorrent(leaves) var peerId = new Buffer('01234567890123456789') diff --git a/test/scrape.js b/test/scrape.js index 05de2d4..66aa475 100644 --- a/test/scrape.js +++ b/test/scrape.js @@ -5,6 +5,7 @@ var commonTest = require('./common') var fs = require('fs') var get = require('simple-get') var parseTorrent = require('parse-torrent') +var path = require('path') var Server = require('../').Server var test = require('tape') @@ -13,7 +14,7 @@ var binaryInfoHash1 = commonLib.hexToBinary(infoHash1) var infoHash2 = 'bbb67059ed6bd08362da625b3ae77f6f4a075bbb' var binaryInfoHash2 = commonLib.hexToBinary(infoHash2) -var bitlove = fs.readFileSync(__dirname + '/torrents/bitlove-intro.torrent') +var bitlove = fs.readFileSync(path.join(__dirname, 'torrents/bitlove-intro.torrent')) var parsedBitlove = parseTorrent(bitlove) var binaryBitlove = commonLib.hexToBinary(parsedBitlove.infoHash)