hunk.code_window:   })
     .catch(t.end)
   })
   test('local file', t => {
     prepare()
     install([local('local-pkg')], { quiet: true })
     .then(() => {
  
hunk.labels: keep keep keep add keep keep keep keep
hunk.after_edit: test('tarballs from GitHub (is-negative)', t => {
     prepare()
     install(['is-negative@https://github.com/kevva/is-negative/archive/1d7e288222b53a0cab90a331f1865220ec29560c.tar.gz'], { quiet: true })
     .then(() => {
       const isNegative = require(
         join(process.cwd(), 'node_modules', 'is-negative'))
       t.ok(isNegative, 'isNegative() is available')
       t.end()
     })
     .catch(t.end)
   })
  
hunk.file_path: test/index.js
hunk.type: add
file: 'use strict'
  const getTarballName = require('./get_tarball_name')
  const crypto = require('crypto')
  
  /**
   * Resolves a 'remote' package.
   *
   *     pkg = {
   *       raw: 'http://registry.npmjs.org/is-array/-/is-array-1.0.1.tgz',
   *       scope: null,
   *       name: null,
   *       rawSpec: 'http://registry.npmjs.org/is-array/-/is-array-1.0.1.tgz',
   *       spec: 'http://registry.npmjs.org/is-array/-/is-array-1.0.1.tgz',
   *       type: 'remote' }
   *     resolveTarball(pkg)
   */
  
  module.exports = function resolveTarball (pkg) {
    const name = getTarballName(pkg.raw)
  
    return Promise.resolve({
      name,
      fullname: name + '#' + hash(pkg.raw),
      dist: {
        tarball: pkg.raw
      }
    })
  }
  
  function hash (str) {
    const hash = crypto.createHash('sha1')
    hash.update(str)
    return hash.digest('hex')
  }
  