-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #146 from dwijnand/UpdateReport.toString
Make sure UpdateReport has a nice toString
- Loading branch information
Showing
3 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package sbt.librarymanagement | ||
|
||
import java.io.File | ||
|
||
import org.scalatest._ | ||
|
||
class UpdateReportSpec extends FlatSpec with Matchers { | ||
"UpdateReport.toString" should "have a nice toString" in { | ||
assert(updateReport.toString === s""" | ||
|Update report: | ||
| Resolve time: 0 ms, Download time: 0 ms, Download size: 0 bytes | ||
| compile: | ||
| org:name | ||
| - 1.0 | ||
| evicted: false | ||
| | ||
|""".stripMargin.drop(1)) | ||
} | ||
|
||
lazy val updateReport = | ||
UpdateReport( | ||
new File("cachedDescriptor.data"), | ||
Vector(configurationReport), | ||
UpdateStats(0, 0, 0, false), | ||
Map.empty | ||
) | ||
|
||
lazy val configurationReport = | ||
ConfigurationReport( | ||
ConfigRef("compile"), | ||
Vector(moduleReport), | ||
Vector(organizationArtifactReport) | ||
) | ||
|
||
lazy val moduleReport = | ||
ModuleReport(ModuleID("org", "name", "1.0"), Vector.empty, Vector.empty) | ||
|
||
lazy val organizationArtifactReport = | ||
OrganizationArtifactReport("org", "name", Vector(moduleReport)) | ||
|
||
} |