File tree Expand file tree Collapse file tree 2 files changed +8
-14
lines changed
sbt-test/sbt-api-mappings/all-libraries
test/scala/com/thoughtworks/sbtApiMappings Expand file tree Collapse file tree 2 files changed +8
-14
lines changed Original file line number Diff line number Diff line change 11def assertDownloadableApiDocumentation (url : URL ) = {
2- import java .net .HttpURLConnection
3- val connection = url.openConnection().asInstanceOf [HttpURLConnection ]
4- try {
5- assert(
6- (200 to 399 ).contains(connection.getResponseCode),
7- s " Unexpected HTTP response code ${connection.getResponseCode} when fetching $url"
8- )
9- } finally {
10- connection.disconnect()
11- }
2+ assert(IO .readLinesURL(url).nonEmpty)
123}
134
145val check = TaskKey [Unit ](" check" )
Original file line number Diff line number Diff line change @@ -6,10 +6,13 @@ import org.scalatest.wordspec.AnyWordSpec
66
77class BootstrapApiMappingsSpec extends AnyWordSpec with Matchers {
88 " BootstrapSbtApiMappings" should {
9- " provide a working default bootstrapJavadocURL" in {
10- val src = Source .fromURL(BootstrapApiMappings .defaultBootstrapJavadocUrl)
11- src.take(200 ).mkString should include(" Generated by javadoc" )
12- src.close()
9+ " provide a working default bootstrapJavadocURL including java.lang package" in {
10+ val src = Source .fromURL(raw " ${BootstrapApiMappings .defaultBootstrapJavadocUrl}java/lang/package-summary.html " )
11+ try {
12+ src.take(200 ).mkString should include(" Generated by javadoc" )
13+ } finally {
14+ src.close()
15+ }
1316 }
1417 }
1518}
You can’t perform that action at this time.
0 commit comments