mirror of https://github.com/sbt/sbt.git
Merge pull request #6 from jozic/updateoptions-tostring
add toString to UpdateOptions
This commit is contained in:
commit
7e87603b5f
|
|
@ -67,6 +67,14 @@ final class UpdateOptions private[sbt] (
|
|||
moduleResolvers
|
||||
)
|
||||
|
||||
override def toString(): String =
|
||||
s"""UpdateOptions(
|
||||
| circularDependencyLevel = $circularDependencyLevel,
|
||||
| latestSnapshots = $latestSnapshots,
|
||||
| consolidatedResolution = $consolidatedResolution,
|
||||
| cachedResolution = $cachedResolution
|
||||
|)""".stripMargin
|
||||
|
||||
override def equals(o: Any): Boolean = o match {
|
||||
case o: UpdateOptions =>
|
||||
this.circularDependencyLevel == o.circularDependencyLevel &&
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
package sbt.librarymanagement
|
||||
|
||||
import sbt.internal.util.UnitSpec
|
||||
|
||||
class UpdateOptionsSpec extends UnitSpec {
|
||||
|
||||
"UpdateOptions" should "have proper toString defined" in {
|
||||
UpdateOptions().toString() should be(
|
||||
"""|UpdateOptions(
|
||||
| circularDependencyLevel = warn,
|
||||
| latestSnapshots = false,
|
||||
| consolidatedResolution = false,
|
||||
| cachedResolution = false
|
||||
|)""".stripMargin)
|
||||
|
||||
UpdateOptions()
|
||||
.withCircularDependencyLevel(CircularDependencyLevel.Error)
|
||||
.withCachedResolution(true)
|
||||
.withLatestSnapshots(true).toString() should be(
|
||||
"""|UpdateOptions(
|
||||
| circularDependencyLevel = error,
|
||||
| latestSnapshots = true,
|
||||
| consolidatedResolution = false,
|
||||
| cachedResolution = true
|
||||
|)""".stripMargin)
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue