Last active
July 24, 2017 06:26
-
-
Save anna-yn/f0185f5077b6b8a60f0a0bed5c8de339 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| /** | |
| * @author Artur Bosch | |
| * https://github.com/arturbosch/detekt/blob/master/detekt-sample-ruleset/src/test/kotlin/io/gitlab/arturbosch/detekt/sampleruleset/TooManyFunctionsSpec.kt | |
| **/ | |
| class TooManyFunctionsSpec : SubjectSpek<TooManyFunctions>({ | |
| subject { TooManyFunctions() } | |
| describe("a simple test") { | |
| it("should find one file with too many functions") { | |
| val findings = subject.lint(code) | |
| assertThat(findings).hasSize(1) | |
| } | |
| } | |
| }) | |
| class TooManyFunctionsTest : RuleTest { | |
| override val rule: Rule = TooManyFunctions() | |
| @Test fun findOneFile() { | |
| val findings = rule.lint(code) | |
| assertThat(findings).hasSize(1) | |
| } | |
| } | |
| val code: String = | |
| """ | |
| Content of a file you want to test against | |
| """ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment