Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 74 lines (59 sloc) 1.6 kB
#!/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"
assertNotCaptured "WARNING: No version of Node.js specified"
assertCaptured "Using Node.js version: 0.6.11"
assertCaptured "Using npm version: 1.1.9"
assertCapturedSuccess
}
testPackageJsonWithoutVersion() {
compile "package-json-noversion"
assertCaptured "WARNING: No version of Node.js specified"
assertCaptured "Using Node.js version: 0.4.7"
assertCaptured "Using npm version: 1.0.106"
assertCapturedSuccess
}
testPackageJsonWithInvalidVersion() {
compile "package-json-invalidversion"
assertCapturedError 1 "Requested engine npm version 1.1.5 does not"
}
testNothingCached() {
cache=$(mktmpdir)
compile "package-json-version" $cache
assertCapturedSuccess
assertEquals "0" "$(ls -1 $cache | wc -l)"
}
## utils ########################################
pushd $(dirname 0) >/dev/null
BASE=$(pwd)
popd >/dev/null
source ${BASE}/vendor/test-utils/test-utils
mktmpdir() {
dir=$(mktemp -t testXXXXX)
rm -rf $dir
mkdir $dir
echo $dir
}
detect() {
capture ${BASE}/bin/detect ${BASE}/test/$1
}
compile() {
capture ${BASE}/bin/compile ${BASE}/test/$1 $2
}
source ${BASE}/vendor/shunit2/shunit2
Jump to Line
Something went wrong with that request. Please try again.