-
Notifications
You must be signed in to change notification settings - Fork 14
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 #599 from micronaut-projects/fix-createReleasesDro…
…pdown Fix create releases dropdown
- Loading branch information
Showing
6 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
...est/gradle-projects/test-micronaut-module/src/main/docs/guide/introduction.adoc
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 @@ | ||
For testing... |
2 changes: 2 additions & 0 deletions
2
src/functionalTest/gradle-projects/test-micronaut-module/src/main/docs/guide/toc.yml
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,2 @@ | ||
introduction: | ||
title: Introduction |
34 changes: 34 additions & 0 deletions
34
src/functionalTest/groovy/io/micronaut/build/ReleasesDropdownFunctionalTest.groovy
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,34 @@ | ||
package io.micronaut.build | ||
|
||
import java.nio.file.Files | ||
|
||
class ReleasesDropdownFunctionalTest extends AbstractFunctionalTest { | ||
|
||
void "version dropdown is populated from github"() { | ||
given: | ||
withSample("test-micronaut-module") | ||
|
||
and: 'we override the github slug to use micronaut-crac' | ||
testDirectory.resolve("gradle.properties").toFile() << "githubSlug=micronaut-projects/micronaut-crac" | ||
|
||
and: 'we copy the grails-doc-files.jar to the prepareDocsResources directory' | ||
def path = Files.createDirectories(testDirectory.resolve("build/tmp/prepareDocsResources")) | ||
def stream = ReleasesDropdownFunctionalTest.getResourceAsStream("/grails-doc-files.jar") | ||
def target = path.resolve("grails-doc-files.jar") | ||
Files.copy(stream, target) | ||
|
||
when: 'we build the docs' | ||
run 'docs' | ||
|
||
and: 'we find all the version options in the dropdown' | ||
def html = testDirectory.resolve("build/docs/guide/index.html").text | ||
def versions = html.findAll("<option.+?value='https://micronaut-projects.github.io/micronaut-crac/([^/]+)") { match, version -> | ||
version | ||
} | ||
|
||
then: 'there are more than 2, and 2 of them are latest and snapshot' | ||
versions.contains('latest') | ||
versions.contains('snapshot') | ||
versions.size() > 2 | ||
} | ||
} |
Binary file not shown.
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