From e18da84ede545721788fec6e061845555a22d8e7 Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Thu, 8 Dec 2022 02:08:30 +0100 Subject: [PATCH] Add requested spec --- spec/ameba/rule/style/query_bool_methods_spec.cr | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/ameba/rule/style/query_bool_methods_spec.cr b/spec/ameba/rule/style/query_bool_methods_spec.cr index 34ea380b..e5716000 100644 --- a/spec/ameba/rule/style/query_bool_methods_spec.cr +++ b/spec/ameba/rule/style/query_bool_methods_spec.cr @@ -25,6 +25,18 @@ module Ameba::Rule::Style CRYSTAL end + it "reports only valid properties" do + expect_issue subject, <<-CRYSTAL + class Foo + class_property? foo = true + class_property bar = true + # ^^^ error: Consider using 'class_property?' for 'bar' + class_property baz = true + # ^^^ error: Consider using 'class_property?' for 'baz' + end + CRYSTAL + end + {% for call in %w[getter class_getter property class_property] %} it "reports `{{ call.id }}` assign with Bool" do expect_issue subject, <<-CRYSTAL, call: {{ call }}