diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2018-11-05 03:00:04 +0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-11-05 21:14:58 +0800 |
commit | bc9dc386625021fec517f2dbf0644ccafe1e32c2 (patch) | |
tree | 12db6817470708c7aa274aa231ef35eb79f2123a /contrib/twirllib/test/src | |
parent | 8afe79afe33be68f59f89b8410984e508c3e8d08 (diff) | |
download | mill-bc9dc386625021fec517f2dbf0644ccafe1e32c2.tar.gz mill-bc9dc386625021fec517f2dbf0644ccafe1e32c2.tar.bz2 mill-bc9dc386625021fec517f2dbf0644ccafe1e32c2.zip |
WIP migrating over from `ammonite.ops` to `os` module.
__.compile works, haven't run tests yet
Diffstat (limited to 'contrib/twirllib/test/src')
-rw-r--r-- | contrib/twirllib/test/src/mill/twirllib/HelloWorldTests.scala | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/contrib/twirllib/test/src/mill/twirllib/HelloWorldTests.scala b/contrib/twirllib/test/src/mill/twirllib/HelloWorldTests.scala index 8ef6ee3e..f14a607b 100644 --- a/contrib/twirllib/test/src/mill/twirllib/HelloWorldTests.scala +++ b/contrib/twirllib/test/src/mill/twirllib/HelloWorldTests.scala @@ -1,6 +1,5 @@ package mill.twirllib -import ammonite.ops.{Path, cp, ls, mkdir, pwd, rm, _} import mill.util.{TestEvaluator, TestUtil} import utest.framework.TestPath import utest.{TestSuite, Tests, assert, _} @@ -8,7 +7,7 @@ import utest.{TestSuite, Tests, assert, _} object HelloWorldTests extends TestSuite { trait HelloBase extends TestUtil.BaseModule { - override def millSourcePath: Path = TestUtil.getSrcPathBase() / millOuterCtx.enclosing.split('.') + override def millSourcePath: os.Path = TestUtil.getSrcPathBase() / millOuterCtx.enclosing.split('.') } trait HelloWorldModule extends mill.twirllib.TwirlModule { @@ -22,20 +21,20 @@ object HelloWorldTests extends TestSuite { } } - val resourcePath: Path = pwd / 'contrib / 'twirllib / 'test / 'resources / "hello-world" + val resourcePath: os.Path = os.pwd / 'contrib / 'twirllib / 'test / 'resources / "hello-world" - def workspaceTest[T](m: TestUtil.BaseModule, resourcePath: Path = resourcePath) + def workspaceTest[T](m: TestUtil.BaseModule, resourcePath: os.Path = resourcePath) (t: TestEvaluator => T) (implicit tp: TestPath): T = { val eval = new TestEvaluator(m) - rm(m.millSourcePath) - rm(eval.outPath) - mkdir(m.millSourcePath / up) - cp(resourcePath, m.millSourcePath) + os.remove.all(m.millSourcePath) + os.remove.all(eval.outPath) + os.makeDir.all(m.millSourcePath / os.up) + os.copy(resourcePath, m.millSourcePath) t(eval) } - def compileClassfiles: Seq[RelPath] = Seq[RelPath]( + def compileClassfiles: Seq[os.RelPath] = Seq[os.RelPath]( "hello.template.scala" ) @@ -54,7 +53,7 @@ object HelloWorldTests extends TestSuite { 'compileTwirl - workspaceTest(HelloWorld) { eval => val Right((result, evalCount)) = eval.apply(HelloWorld.core.compileTwirl) - val outputFiles = ls.rec(result.classes.path) + val outputFiles = os.walk(result.classes.path) val expectedClassfiles = compileClassfiles.map( eval.outPath / 'core / 'compileTwirl / 'dest / 'html / _ ) |