mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Synchronize properties context names in rules’ specs
This commit is contained in:
parent
8112dddc8f
commit
70078cf77f
11 changed files with 13 additions and 13 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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) )
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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|
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue