-
Notifications
You must be signed in to change notification settings - Fork 11
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 #189 from grails/buildPluginVersion
Move Gradle build plugin version to settings.gradle
- Loading branch information
Showing
5 changed files
with
64 additions
and
22 deletions.
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
66 changes: 47 additions & 19 deletions
66
...ls-forge-core/src/test/groovy/org/grails/forge/feature/asciidoctor/AsciidoctorSpec.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 |
---|---|---|
@@ -1,35 +1,63 @@ | ||
package org.grails.forge.feature.asciidoctor | ||
|
||
import io.micronaut.core.version.SemanticVersion | ||
import org.grails.forge.ApplicationContextSpec | ||
import org.grails.forge.BuildBuilder | ||
import spock.lang.Unroll | ||
import org.grails.forge.application.ApplicationType | ||
import org.grails.forge.feature.Features | ||
import org.grails.forge.fixture.CommandOutputFixture | ||
import org.grails.forge.options.JdkVersion | ||
import org.grails.forge.options.Options | ||
import org.grails.forge.options.TestFramework | ||
|
||
class AsciidoctorSpec extends ApplicationContextSpec { | ||
class AsciidoctorSpec extends ApplicationContextSpec implements CommandOutputFixture { | ||
|
||
@Unroll | ||
void 'test gradle asciidoctor feature'() { | ||
when: | ||
String template = new BuildBuilder(beanContext) | ||
.features(['asciidoctor']) | ||
.render() | ||
final Features features = getFeatures(["asciidoctor"]) | ||
|
||
then: | ||
template.contains("apply from: \"gradle/asciidoc.gradle\"") | ||
features.contains("asciidoctor") | ||
} | ||
|
||
when: | ||
String pluginId = 'org.asciidoctor.jvm.convert' | ||
String applyPlugin = 'id "' + pluginId + '" version "' | ||
void "test asciidoctor gradle configurations"() { | ||
given: | ||
final def output = generate(ApplicationType.WEB, new Options(TestFramework.SPOCK, JdkVersion.JDK_11), ["asciidoctor"]) | ||
final def buildGradle = output["build.gradle"] | ||
final def settingGradle = output["settings.gradle"] | ||
|
||
then: | ||
template.contains(applyPlugin) | ||
expect: | ||
settingGradle.contains("id \"org.asciidoctor.jvm.convert\" version \"4.0.0-alpha.1\"") | ||
buildGradle.contains("apply from: \"gradle/asciidoc.gradle\"") | ||
} | ||
|
||
when: | ||
Optional<SemanticVersion> semanticVersionOptional = parseCommunityGradlePluginVersion(pluginId, template).map(SemanticVersion::new) | ||
void "test asciidoctor gradle configurations"() { | ||
given: | ||
final def output = generate(ApplicationType.WEB, new Options(TestFramework.SPOCK, JdkVersion.JDK_11), ["asciidoctor"]) | ||
final def asciidocGradle = output["gradle/asciidoc.gradle"] | ||
|
||
expect: | ||
asciidocGradle.contains("""asciidoctorj { | ||
version '2.1.0' | ||
modules { | ||
diagram { | ||
version '1.5.18' | ||
} | ||
} | ||
then: | ||
noExceptionThrown() | ||
semanticVersionOptional.isPresent() | ||
options doctype: "book", ruby: "erubis" | ||
attributes "sourcedir": "src/docs/asciidoc", | ||
"source-highlighter": "coderay", | ||
"toc": "left", | ||
"idprefix": "", | ||
"idseparator": "-", | ||
"icons": "font", | ||
"setanchors": "", | ||
"listing-caption": "", | ||
"imagesdir": "images", | ||
"project-version": "\$project.version", | ||
"revnumber": "\$project.version" | ||
} | ||
""") | ||
} | ||
|
||
} |
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