-
Notifications
You must be signed in to change notification settings - Fork 88
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 #338 from nebula-plugins/fixme-rule-can-be-noncrit…
…ical Fixme violations can be noncritical when a property is passed in
- Loading branch information
Showing
2 changed files
with
47 additions
and
0 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
40 changes: 40 additions & 0 deletions
40
src/test/groovy/com/netflix/nebula/lint/rule/FixmeRuleSpec.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,40 @@ | ||
package com.netflix.nebula.lint.rule | ||
|
||
import nebula.test.IntegrationTestKitSpec | ||
import spock.lang.Subject | ||
|
||
@Subject(FixmeRule) | ||
class FixmeRuleSpec extends IntegrationTestKitSpec { | ||
def tasks = ['assemble', 'fixGradleLint'] | ||
|
||
def setup() { | ||
def oldDate = '2010-12-1' | ||
buildFile.text = """ | ||
plugins { | ||
id 'nebula.lint' | ||
id 'java-library' | ||
} | ||
gradleLint.rules = ['minimum-dependency-version'] | ||
repositories { mavenCentral() } | ||
dependencies { | ||
gradleLint.fixme('$oldDate') { | ||
implementation 'com.google.guava:guava:18.+' | ||
} | ||
} | ||
""".stripIndent() | ||
} | ||
|
||
def 'expired fixmes are critical violations'() { | ||
expect: | ||
def result = runTasksAndFail(*tasks) | ||
result.output.contains('needs fixing') | ||
result.output.contains('critical lint violation') | ||
} | ||
|
||
def 'expired fixmes are noncritical violations when a property is used'() { | ||
expect: | ||
def result = runTasks(*tasks, '-Dnebula.lint.fixmeAsNonCritical=true') | ||
result.output.contains('needs fixing') | ||
!result.output.contains('critical lint violation') | ||
} | ||
} |