Add requested spec

This commit is contained in:
Sijawusz Pur Rahnama 2022-12-08 02:08:30 +01:00
parent cdf0405496
commit e18da84ede

View file

@ -25,6 +25,18 @@ module Ameba::Rule::Style
CRYSTAL CRYSTAL
end 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] %} {% for call in %w[getter class_getter property class_property] %}
it "reports `{{ call.id }}` assign with Bool" do it "reports `{{ call.id }}` assign with Bool" do
expect_issue subject, <<-CRYSTAL, call: {{ call }} expect_issue subject, <<-CRYSTAL, call: {{ call }}