Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 52 lines (41 sloc) 1.084 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
#!/usr/bin/env bash

#
# Create a Heroku app with the following buildpack:
# https://github.com/ddollar/buildpack-test
#
# Push this Node.js buildpack to that Heroku app to
# run the tests
#

testDetectWithPackageJson() {
  detect "package-json-version"
  assertCaptured "Node.js"
  assertCapturedSuccess
}

testDetectWithoutPackageJson() {
  detect "no-package-json"
  assertCapturedError 1 ""
}

testPackageJsonWithVersion() {
  compile "package-json-version"
  assertCaptured "Using Node.js version: 0.6.11"
  assertCaptured "Using npm version: 1.1.9"
  assertCapturedSuccess
}

testPackageJsonWithNoVersion() {
  compile "package-json-noversion"
  assertCaptured "Using Node.js version: 0.4.7"
  assertCaptured "Using npm version: 1.0.106"
  assertCapturedSuccess
}

## utils ########################################

pushd $(dirname 0) >/dev/null
BASE=$(pwd)
popd >/dev/null

source ${BASE}/vendor/test-utils/test-utils

detect() {
  capture ${BASE}/bin/detect ${BASE}/test/$1
}

compile() {
  capture ${BASE}/bin/compile ${BASE}/test/$1
}

source ${BASE}/vendor/shunit2/shunit2
Something went wrong with that request. Please try again.