From 9bf62ed1352b79e1567e130af8182dc38a5390c5 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Fri, 5 Feb 2016 14:32:52 -0800 Subject: [PATCH] standard 6 prep --- test/basic.js | 9 +++++---- test/fetch.js | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) 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')