mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Do not report if Object#to_s is called without receiver
This commit is contained in:
parent
ff1669ebe8
commit
59bc021e57
2 changed files with 15 additions and 1 deletions
|
@ -52,6 +52,20 @@ module Ameba::Rule::Lint
|
|||
subject.catch(s).should_not be_valid
|
||||
end
|
||||
|
||||
it "doesn't report if Object#to_s is called with arguments" do
|
||||
s = Source.new %q(
|
||||
/\w #{name.to_s(io)}/
|
||||
)
|
||||
subject.catch(s).should be_valid
|
||||
end
|
||||
|
||||
it "doesn't report if Object#to_s is called without receiver" do
|
||||
s = Source.new %q(
|
||||
/\w #{to_s}/
|
||||
)
|
||||
subject.catch(s).should be_valid
|
||||
end
|
||||
|
||||
it "reports rule, location and message" do
|
||||
s = Source.new %q(
|
||||
"Hello, #{name1.to_s}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue