/**
 * @overview Assert that all resource url available.
 * @param {string[]} resourceURLs - Resource url.
 * @param {function} callback - Callback when done.
 */

var assert = require('assert'),
    request = require('request'),
    async = require('async');

module.exports = function (resourceURLs, callback) {
    async.parallel(
        resourceURLs.map(function (resourceURL) {
            return function (callback) {
                request.get(resourceURL, function (err, res) {
                    assert.ifError(err);
                    assert.equal(res.statusCode, 200);
                    callback(err);
                });
            }
        }),
        callback
    );
};