Synchronize properties context names in rules’ specs

This commit is contained in:
Sijawusz Pur Rahnama 2022-12-19 20:44:32 +01:00
parent 8112dddc8f
commit 70078cf77f
11 changed files with 13 additions and 13 deletions

View file

@ -34,7 +34,7 @@ module Ameba::Rule::Layout
end
context "properties" do
it "allows to configure max length of the line" do
it "#max_length" do
rule = LineLength.new
rule.max_length = long_line.size

View file

@ -68,14 +68,14 @@ module Ameba::Rule::Lint
end
context "properties" do
it "allows to configure string_array_unwanted_symbols" do
it "#string_array_unwanted_symbols" do
rule = PercentArrays.new
rule.string_array_unwanted_symbols = ","
s = Source.new %( %w("one") )
rule.catch(s).should be_valid
end
it "allows to configure symbol_array_unwanted_symbols" do
it "#symbol_array_unwanted_symbols" do
rule = PercentArrays.new
rule.symbol_array_unwanted_symbols = ","
s = Source.new %( %i(:one) )

View file

@ -46,7 +46,7 @@ module Ameba::Rule::Performance
end
context "properties" do
it "allows to configure object_call_names" do
it "#filter_names" do
rule = AnyAfterFilter.new
rule.filter_names = %w(select)

View file

@ -44,7 +44,7 @@ module Ameba::Rule::Performance
end
context "properties" do
it "allows to configure `call_names`" do
it "#call_names" do
rule = ChainedCallWithNoBang.new
rule.call_names = %w(uniq)

View file

@ -62,7 +62,7 @@ module Ameba::Rule::Performance
end
context "properties" do
it "allows to configure object_call_names" do
it "#filter_names" do
rule = FirstLastAfterFilter.new
rule.filter_names = %w(reject)

View file

@ -44,7 +44,7 @@ module Ameba::Rule::Performance
end
context "properties" do
it "allows to configure object caller names" do
it "#filter_names" do
rule = SizeAfterFilter.new
rule.filter_names = %w(select)

View file

@ -42,7 +42,7 @@ module Ameba::Rule::Style
end
context "properties" do
it "allows to configure filter_names" do
it "#filter_names" do
rule = IsAFilter.new
rule.filter_names = %w(select)

View file

@ -130,7 +130,7 @@ module Ameba
end
context "properties" do
it "allows to configure integer min digits" do
it "#int_min_digits" do
rule = Rule::Style::LargeNumbers.new
rule.int_min_digits = 10
expect_no_issues rule, %q(1200000)

View file

@ -43,7 +43,7 @@ module Ameba::Rule::Style
end
context "properties" do
context "#exclude_ternary=" do
context "#exclude_ternary" do
it "skips ternary control expressions by default" do
expect_no_issues subject, <<-CRYSTAL
(foo > bar) ? true : false
@ -75,7 +75,7 @@ module Ameba::Rule::Style
end
end
context "#allow_safe_assignment=" do
context "#allow_safe_assignment" do
it "reports assignments by default" do
expect_issue subject, <<-CRYSTAL
if (foo = @foo)

View file

@ -201,7 +201,7 @@ module Ameba::Rule::Style
end
context "properties" do
context "#allow_multi_next=" do
context "#allow_multi_next" do
it "allows multi next statements by default" do
expect_no_issues subject, <<-CRYSTAL
block do |a, b|

View file

@ -284,7 +284,7 @@ module Ameba::Rule::Style
end
context "properties" do
context "#allow_multi_return=" do
context "#allow_multi_return" do
it "allows multi returns by default" do
expect_no_issues subject, <<-CRYSTAL
def method(a, b)