I have to test a program which takes one input file. I have put all the input files inside a folder and now I want to use SBT and ScalaTest to have following features:
- TestAll : Invoke the program with one input file at a time for all files
- Test one: Invoke the program with one input file provided as argument to
test
command from sbt console
For the time being foldername is a fixed path, so list of all files can be obtained by:
val dir = new File("tests\\");
val files = dir.listFiles.filter(
f => """.*\.extension$""".r.findFirstIn(f.getName).isDefined);
Can any one give me a brief idea as to which scalatest class is best suited for this purpose?