From 5b2e3e5487a1df237157ad40fcce817234ca5388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brais=20Gab=C3=ADn?= Date: Tue, 16 Nov 2021 23:59:11 +0100 Subject: [PATCH] Move test to the correct scope --- .../detekt/rules/style/UnnecessaryLetSpec.kt | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/detekt-rules-style/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnnecessaryLetSpec.kt b/detekt-rules-style/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnnecessaryLetSpec.kt index f022f5ca41f..82d1de36d30 100644 --- a/detekt-rules-style/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnnecessaryLetSpec.kt +++ b/detekt-rules-style/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnnecessaryLetSpec.kt @@ -344,37 +344,37 @@ class UnnecessaryLetSpec : Spek({ assertThat(findings).hasSize(1) assertThat(findings).allMatch { it.message == MESSAGE_USE_IF } } + } - it("reports when implicit parameter isn't used") { - val content = """ - fun test(value: Int?) { - value?.let { - listOf(1).map { it } - } + it("reports when implicit parameter isn't used") { + val content = """ + fun test(value: Int?) { + value?.let { + listOf(1).map { it } } - """ - val findings = subject.compileAndLintWithContext(env, content) - assertThat(findings).hasSize(1) - assertThat(findings).allMatch { it.message == MESSAGE_USE_IF } - } + } + """ + val findings = subject.compileAndLintWithContext(env, content) + assertThat(findings).hasSize(1) + assertThat(findings).allMatch { it.message == MESSAGE_USE_IF } + } - it("does not report when an implicit parameter is used in an inner lambda") { - val content = """ - fun callMe(callback: () -> Unit) { - callback() - } - - fun test(value: Int?) { - value?.let { - callMe { - println(it) - } - } + it("does not report when an implicit parameter is used in an inner lambda") { + val content = """ + fun callMe(callback: () -> Unit) { + callback() + } + + fun test(value: Int?) { + value?.let { + callMe { + println(it) + } } - """ - val findings = subject.compileAndLintWithContext(env, content) - assertThat(findings).isEmpty() - } + } + """ + val findings = subject.compileAndLintWithContext(env, content) + assertThat(findings).isEmpty() } } })