From 903f2913d241cdea1fcd36c74a91a9614e5b6b3c Mon Sep 17 00:00:00 2001 From: James Carnegie Date: Mon, 24 Apr 2017 22:55:28 +0100 Subject: [PATCH] project.findFile fixed to work with paths starting / #523 --- CHANGELOG.md | 3 +++ pom.xml | 2 +- .../rug/kind/core/ProjectMutableViewTest.scala | 11 +++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f62203629..e3af4ea75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed +- project.findFile now works on paths starting with a '/' + https://github.com/atomist/rug/issues/523 + - Rug Function exceptions are now passed to error handlers. Maybe: Response now passed to handlers when unknown Rug Functions are encountered https://github.com/atomist/rug/issues/536 diff --git a/pom.xml b/pom.xml index 464c41bc4..6d57ae204 100644 --- a/pom.xml +++ b/pom.xml @@ -39,7 +39,7 @@ com.atomist artifact-source - 0.20.0 + 0.25.0 diff --git a/src/test/scala/com/atomist/rug/kind/core/ProjectMutableViewTest.scala b/src/test/scala/com/atomist/rug/kind/core/ProjectMutableViewTest.scala index c39f6d334..c10b71a63 100644 --- a/src/test/scala/com/atomist/rug/kind/core/ProjectMutableViewTest.scala +++ b/src/test/scala/com/atomist/rug/kind/core/ProjectMutableViewTest.scala @@ -476,6 +476,17 @@ class ProjectMutableViewTest extends FlatSpec with Matchers { assert(path.contains("classDeclaration")) } + it should "find files in the root with /" in { + val pmv = new ProjectMutableView(SimpleFileBasedArtifactSource( + StringFileArtifact("Foo.java", + """ + |public class Foo { + |} + """.stripMargin) + )) + assert(pmv.findFile("/Foo.java") != null) + } + private def moveAFileAndVerifyNotFoundAtFormerAddress(stuffToDoLater: ProjectMutableView => Unit) = { val project = JavaTypeUsageTest.NewSpringBootProject val pmv = new ProjectMutableView(backingTemplates, project)