Skip to content

Instantly share code, notes, and snippets.

@anna-yn
Last active July 24, 2017 06:26
Show Gist options
  • Select an option

  • Save anna-yn/f0185f5077b6b8a60f0a0bed5c8de339 to your computer and use it in GitHub Desktop.

Select an option

Save anna-yn/f0185f5077b6b8a60f0a0bed5c8de339 to your computer and use it in GitHub Desktop.
/**
* @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