Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve tests; misc fixes #532

Merged
merged 9 commits into from Dec 18, 2015

test: make fixtures work with brfs

  • Loading branch information
feross committed Dec 17, 2015
commit 38e8383bf146f965c3712b095cbbc203f8d787cb
@@ -2,49 +2,44 @@ var fs = require('fs')
var path = require('path')
var parseTorrent = require('parse-torrent')

var content = path.join(__dirname, 'content')
var torrents = path.join(__dirname, 'torrents')

module.exports = {
// Leaves of Grass by Walt Whitman.epub
leaves: {
contentPath: path.join(content, 'Leaves of Grass by Walt Whitman.epub'),
torrentPath: path.join(torrents, 'leaves.torrent'),
content: fs.readFileSync(
path.join(content, 'Leaves of Grass by Walt Whitman.epub')
),
torrent: fs.readFileSync(path.join(torrents, 'leaves.torrent')),
contentPath: path.join(__dirname, 'content', 'Leaves of Grass by Walt Whitman.epub'),
torrentPath: path.join(__dirname, 'torrents', 'leaves.torrent'),
content: fs.readFileSync(path.join(__dirname, 'content', 'Leaves of Grass by Walt Whitman.epub')),
torrent: fs.readFileSync(path.join(__dirname, 'torrents', 'leaves.torrent')),
parsedTorrent: parseTorrent(
fs.readFileSync(path.join(torrents, 'leaves.torrent'))
fs.readFileSync(path.join(__dirname, 'torrents', 'leaves.torrent'))
),
magnetURI: parseTorrent.toMagnetURI(parseTorrent(
fs.readFileSync(path.join(torrents, 'leaves.torrent'))
fs.readFileSync(path.join(__dirname, 'torrents', 'leaves.torrent'))
))
},

// Folder which contains single file
folder: {
contentPath: path.join(content, 'folder'),
torrentPath: path.join(torrents, 'folder.torrent'),
torrent: fs.readFileSync(path.join(torrents, 'folder.torrent')),
contentPath: path.join(__dirname, 'content', 'folder'),
torrentPath: path.join(__dirname, 'torrents', 'folder.torrent'),
torrent: fs.readFileSync(path.join(__dirname, 'torrents', 'folder.torrent')),
parsedTorrent: parseTorrent(
fs.readFileSync(path.join(torrents, 'folder.torrent'))
fs.readFileSync(path.join(__dirname, 'torrents', 'folder.torrent'))
),
magnetURI: parseTorrent.toMagnetURI(parseTorrent(
fs.readFileSync(path.join(torrents, 'folder.torrent'))
fs.readFileSync(path.join(__dirname, 'torrents', 'folder.torrent'))
))
},

// Folder which contains multiple files
numbers: {
contentPath: path.join(content, 'numbers'),
torrentPath: path.join(torrents, 'numbers.torrent'),
torrent: fs.readFileSync(path.join(torrents, 'numbers.torrent')),
contentPath: path.join(__dirname, 'content', 'numbers'),
torrentPath: path.join(__dirname, 'torrents', 'numbers.torrent'),
torrent: fs.readFileSync(path.join(__dirname, 'torrents', 'numbers.torrent')),
parsedTorrent: parseTorrent(
fs.readFileSync(path.join(torrents, 'numbers.torrent'))
fs.readFileSync(path.join(__dirname, 'torrents', 'numbers.torrent'))
),
magnetURI: parseTorrent.toMagnetURI(parseTorrent(
fs.readFileSync(path.join(torrents, 'numbers.torrent'))
fs.readFileSync(path.join(__dirname, 'torrents', 'numbers.torrent'))
))
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.