Skip to content

Commit

Permalink
Verify old extension syntax works
Browse files Browse the repository at this point in the history
Want a test to verify this until we remove the deprecated methods.
  • Loading branch information
ajoberstar committed May 30, 2018
1 parent 9e9eafe commit 5a3984d
Showing 1 changed file with 29 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ reckon {
result.task(':reckonTagPush').outcome == TaskOutcome.SKIPPED
}


def 'if reckoned version is SNAPSHOT no tag created'() {
given:
def local = Grgit.clone(dir: projectDir, uri: remote.repository.rootDir)
Expand All @@ -127,7 +126,7 @@ reckon {
result.task(':reckonTagPush').outcome == TaskOutcome.SKIPPED
}

def 'if reckoned version has no build metadata tag created and pushed'() {
def 'if reckoned version is significant tag created and pushed'() {
given:
def local = Grgit.clone(dir: projectDir, uri: remote.repository.rootDir)

Expand Down Expand Up @@ -179,6 +178,34 @@ reckon {
result.task(':reckonTagPush').outcome == TaskOutcome.SKIPPED
}

def 'old syntax of extension does not fail'() {
given:
def local = Grgit.clone(dir: projectDir, uri: remote.repository.rootDir)

buildFile << """
plugins {
id 'org.ajoberstar.reckon'
}
reckon {
normal = scopeFromProp()
preRelease = stageFromProp('alpha','beta', 'final')
}
task printVersion {
doLast {
println project.version
}
}
"""
local.add(patterns: ['build.gradle'])
local.commit(message: 'Build file')
when:
def result = build('printVersion')
then:
result.output.contains('Reckoned version: 1.1.0-alpha.0')
}

private BuildResult build(String... args = []) {
return GradleRunner.create()
.withGradleVersion(System.properties['compat.gradle.version'])
Expand Down

0 comments on commit 5a3984d

Please sign in to comment.