@@ -43,7 +43,7 @@ func testDetect(t *testing.T, when spec.G, it spec.S) {
4343 })
4444
4545 it ("should request the node version in the buildpack.yml" , func () {
46- buildPlan = getStandardBuildplanWithNodeVersion (buildpackYamlVersion )
46+ buildPlan = getStandardBuildplanWithNodeVersion (buildpackYamlVersion , "buildpack.yml" )
4747 runDetectAndExpectBuildplan (factory , buildPlan , t )
4848 })
4949 })
@@ -54,7 +54,7 @@ func testDetect(t *testing.T, when spec.G, it spec.S) {
5454 })
5555
5656 it ("should request the node version in the .nvmrc file" , func () {
57- buildPlan = getStandardBuildplanWithNodeVersion (nvmrcVersion )
57+ buildPlan = getStandardBuildplanWithNodeVersion (nvmrcVersion , ".nvmrc" )
5858 runDetectAndExpectBuildplan (factory , buildPlan , t )
5959 })
6060 })
@@ -66,7 +66,7 @@ func testDetect(t *testing.T, when spec.G, it spec.S) {
6666 })
6767
6868 it ("should request the node version in the buildpack.yml" , func () {
69- buildPlan = getStandardBuildplanWithNodeVersion (buildpackYamlVersion )
69+ buildPlan = getStandardBuildplanWithNodeVersion (buildpackYamlVersion , "buildpack.yml" )
7070 runDetectAndExpectBuildplan (factory , buildPlan , t )
7171 })
7272 })
@@ -78,7 +78,7 @@ func testDetect(t *testing.T, when spec.G, it spec.S) {
7878 })
7979
8080 it ("should request the node version in the .nvmrc" , func () {
81- buildPlan = getStandardBuildplanWithNodeVersion (nvmrcVersion )
81+ buildPlan = getStandardBuildplanWithNodeVersion (nvmrcVersion , "buildpack.yml" )
8282 runDetectAndExpectBuildplan (factory , buildPlan , t )
8383 })
8484 })
@@ -95,14 +95,15 @@ func runDetectAndExpectBuildplan(factory *test.DetectFactory, buildplan buildpla
9595 Expect (factory .Plans .Plan ).To (Equal (buildplan ))
9696}
9797
98- func getStandardBuildplanWithNodeVersion (version string ) buildplan.Plan {
98+ func getStandardBuildplanWithNodeVersion (version , versionSource string ) buildplan.Plan {
9999 return buildplan.Plan {
100100 Provides : []buildplan.Provided {{Name : node .Dependency }},
101101 Requires : []buildplan.Required {{
102102 Name : node .Dependency ,
103103 Version : version ,
104104 Metadata : buildplan.Metadata {
105- "launch" : true ,
105+ "launch" : true ,
106+ node .VersionSource : versionSource ,
106107 }}},
107108 }
108109}
0 commit comments