@@ -5,12 +5,25 @@ import org.scalasteward.core.buildtool.BuildRoot
5
5
import org .scalasteward .core .buildtool .sbt .command ._
6
6
import org .scalasteward .core .data .{GroupId , Repo , Version }
7
7
import org .scalasteward .core .edit .scalafix .ScalafixMigration
8
+ import org .scalasteward .core .git .FileGitAlg
8
9
import org .scalasteward .core .mock .MockContext .context ._
9
10
import org .scalasteward .core .mock .MockState
10
11
import org .scalasteward .core .mock .MockState .TraceEntry .{Cmd , Log }
11
12
import org .scalasteward .core .util .Nel
12
13
13
14
class ScalaCliAlgTest extends CatsEffectSuite {
15
+ test(" containsBuild: directive in non-source file" ) {
16
+ val repo = Repo (" user" , " repo" )
17
+ val buildRoot = BuildRoot (repo, " ." )
18
+ val fileWithUsingLib = " test.md" // this test fails if the extension is .scala or .sc
19
+ val grepCmd = FileGitAlg .gitCmd.toList ++
20
+ List (" grep" , " -I" , " --fixed-strings" , " --files-with-matches" , " //> using lib " )
21
+ val initial =
22
+ MockState .empty.copy(commandOutputs = Map (grepCmd -> Right (List (fileWithUsingLib))))
23
+ val obtained = scalaCliAlg.containsBuild(buildRoot).runA(initial)
24
+ assertIO(obtained, false )
25
+ }
26
+
14
27
test(" getDependencies" ) {
15
28
val repo = Repo (" user" , " repo" )
16
29
val buildRoot = BuildRoot (repo, " ." )
0 commit comments