Permalink
Browse files

Work with templates in any directory.

Now, with test!

Fixed #45.
  • Loading branch information...
1 parent 89e7efe commit 4ef479e7728732748d12cc388dead8b93305f973 @dragos committed Apr 4, 2013
@@ -91,7 +91,13 @@ class TemplateCompilationUnitTest {
assertTrue("Creating a `TemplateCompilationUnit` should force the underlying project to automatically add the Scala nature.", project.hasScalaNature)
}
-
+
+ @Test
+ def views_in_non_standard_folder_work() {
+ val tFile = file("moreviews/more.scala.html")
+ val tu = TemplateCompilationUnit(tFile)
+ assertTrue(s"No errors expected ${tu.currentProblems.map(_.getMessage())}", tu.generatedSource.isSuccess)
+ }
}
/**
@@ -0,0 +1,3 @@
+@(message: String)
+
+<html><body>@message</body></html>
@@ -51,7 +51,7 @@ class PlayProject private (val scalaProject: ScalaProject) {
*
* @return the absolute location of the `/app/views` directory, below the project root
*/
- lazy val sourceDir = new File(scalaProject.underlying.getLocation().toString() + "/app/views")
+ lazy val sourceDir = scalaProject.underlying.getLocation().toFile()
}
object PlayProject {

0 comments on commit 4ef479e

Please sign in to comment.