giter8 icon indicating copy to clipboard operation
giter8 copied to clipboard

Scaffold does not copy "test" directory

Open wsargent opened this issue 9 years ago • 1 comments

From https://github.com/playframework/play-scala-seed.g8

There's a scaffold called "form" which contains a controller and a spec file associated with it. When the spec is in a directory called "test", then the specification is never copied into the project.

Steps to reproduce:

g8 playframework/play-scala-seed --name=another --force
cd another
sbt
[another] $ g8Scaffold form

Generates a Controller with form handling

model [user]: derp
Skipping existing file: /Users/wsargent/work/templates/another/./generated-test/README.md
Success :)
[success] Total time: 19 s, completed Oct 26, 2016 6:48:11 PM

You can see there's a "generated-test" directory:

ls -l generated-test/controllers
total 8
-rw-r--r--  1 wsargent  staff  2285 Oct 26 18:48 DerpControllerSpec.scala

Now if we go into .g8 and rename "generated-test" to "test"

cd .g8/form
mv generated-test test

and then try it again:

cd another
sbt "g8Scaffold form"

Generates a Controller with form handling

model [user]: quux

then there is no test/controllers/QuuxControllerSpec.scalacreated.

wsargent avatar Oct 27 '16 01:10 wsargent

Maybe fixed by #338? Maybe related to #394?

ches avatar Feb 03 '19 20:02 ches

This issue has been fixed in #338 and can be closed. I can confirm it works now (we have a test folder in the play see projects: https://github.com/playframework/play-scala-seed.g8/tree/2.8.x/src/main/scaffolds/form)

mkurz avatar Mar 03 '23 20:03 mkurz