blob: 3bcd180f8237d7fd094fde11e1a056b8d10b648d [file] [log] [blame]
package com.github.shyiko.ktlint.ruleset.standard
import com.github.shyiko.ktlint.test.format
import org.assertj.core.api.Assertions.assertThat
import org.testng.annotations.Test
class NoEmptyClassBodyRuleTest {
@Test
fun testLint() {
testLintUsingResource(NoEmptyClassBodyRule())
}
@Test
fun testFormat() {
testFormatUsingResource(NoEmptyClassBodyRule())
}
@Test
fun testFormatEmptyClassBodyAtTheEndOfFile() {
assertThat(NoEmptyClassBodyRule().format("class A {}\n")).isEqualTo("class A\n")
assertThat(NoEmptyClassBodyRule().format("class A {}")).isEqualTo("class A")
}
}