mirror of
https://github.com/sbt/sbt.git
synced 2026-09-04 08:45:56 +02:00
Merge pull request #6 from jozic/updateoptions-tostring
add toString to UpdateOptions
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user