Added test for wildcards in org and name

This commit is contained in:
Dennis Hörsch 2018-03-03 13:31:26 +01:00 committed by Dale Wijnand
parent c9e4ace8de
commit 245997c84e
No known key found for this signature in database
GPG Key ID: 4F256E3D151DF5EF
1 changed files with 19 additions and 0 deletions

View File

@ -27,6 +27,13 @@ class InclExclSpec extends BaseIvySpecification {
)
}
def testScalaLibraryIsMissing(report: UpdateReport): Assertion = {
assert(
!report.allModules.exists(_.name.contains("scala-library")),
"scala-library has not been excluded."
)
}
def testScalahostIsMissing(report: UpdateReport): Assertion = {
assert(
!report.allModules.exists(_.name.contains("scalahost")),
@ -65,4 +72,16 @@ class InclExclSpec extends BaseIvySpecification {
val report = getIvyReport(createMetaDep(excluded), scala2122)
testScalahostIsMissing(report)
}
it should "exclude any version of scala-library via * artifact id" in {
val toExclude = ExclusionRule("org.scala-lang", "*")
val report = getIvyReport(createLiftDep(toExclude), scala210)
testScalaLibraryIsMissing(report)
}
it should "exclude any version of scala-library via * org id" in {
val toExclude = ExclusionRule("*", "scala-library")
val report = getIvyReport(createLiftDep(toExclude), scala210)
testScalaLibraryIsMissing(report)
}
}