55 "path/filepath"
66 "testing"
77
8+ "github.com/cloudfoundry/libcfbuildpack/buildpackplan"
9+
810 "github.com/cloudfoundry/node-engine-cnb/node"
911
1012 "github.com/buildpack/libbuildpack/buildplan"
@@ -43,7 +45,7 @@ func testDetect(t *testing.T, when spec.G, it spec.S) {
4345 })
4446
4547 it ("should request the node version in the buildpack.yml" , func () {
46- buildPlan = getStandardBuildplanWithNodeVersion (buildpackYamlVersion , "buildpack.yml" )
48+ buildPlan = getStandardBuildplanWithNodeVersion (buildpackYamlVersion , node . BuildpackYAMLSource )
4749 runDetectAndExpectBuildplan (factory , buildPlan , t )
4850 })
4951 })
@@ -54,7 +56,7 @@ func testDetect(t *testing.T, when spec.G, it spec.S) {
5456 })
5557
5658 it ("should request the node version in the .nvmrc file" , func () {
57- buildPlan = getStandardBuildplanWithNodeVersion (nvmrcVersion , ".nvmrc" )
59+ buildPlan = getStandardBuildplanWithNodeVersion (nvmrcVersion , node . NvmrcSource )
5860 runDetectAndExpectBuildplan (factory , buildPlan , t )
5961 })
6062 })
@@ -66,7 +68,7 @@ func testDetect(t *testing.T, when spec.G, it spec.S) {
6668 })
6769
6870 it ("should request the node version in the buildpack.yml" , func () {
69- buildPlan = getStandardBuildplanWithNodeVersion (buildpackYamlVersion , "buildpack.yml" )
71+ buildPlan = getStandardBuildplanWithNodeVersion (buildpackYamlVersion , node . BuildpackYAMLSource )
7072 runDetectAndExpectBuildplan (factory , buildPlan , t )
7173 })
7274 })
@@ -78,7 +80,7 @@ func testDetect(t *testing.T, when spec.G, it spec.S) {
7880 })
7981
8082 it ("should request the node version in the .nvmrc" , func () {
81- buildPlan = getStandardBuildplanWithNodeVersion (nvmrcVersion , "buildpack.yml" )
83+ buildPlan = getStandardBuildplanWithNodeVersion (nvmrcVersion , node . BuildpackYAMLSource )
8284 runDetectAndExpectBuildplan (factory , buildPlan , t )
8385 })
8486 })
@@ -102,8 +104,8 @@ func getStandardBuildplanWithNodeVersion(version, versionSource string) buildpla
102104 Name : node .Dependency ,
103105 Version : version ,
104106 Metadata : buildplan.Metadata {
105- "launch" : true ,
106- node .VersionSource : versionSource ,
107+ "launch" : true ,
108+ buildpackplan .VersionSource : versionSource ,
107109 }}},
108110 }
109111}
0 commit comments