mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Rename s
to source
This commit is contained in:
parent
c2aa2fedb6
commit
78071722c4
2 changed files with 8 additions and 8 deletions
|
@ -13,18 +13,18 @@ module Ameba::Rule::Layout
|
||||||
end
|
end
|
||||||
|
|
||||||
it "fails if there is no blank lines at the end" do
|
it "fails if there is no blank lines at the end" do
|
||||||
s = expect_issue subject, "no-blankline # error: Trailing newline missing"
|
source = expect_issue subject, "no-blankline # error: Trailing newline missing"
|
||||||
expect_correction s, "no-blankline\n"
|
expect_correction source, "no-blankline\n"
|
||||||
end
|
end
|
||||||
|
|
||||||
it "fails if there more then one blank line at the end of a source" do
|
it "fails if there more then one blank line at the end of a source" do
|
||||||
s = expect_issue subject, "a = 1\n \n # error: Excessive trailing newline detected", normalize: false
|
source = expect_issue subject, "a = 1\n \n # error: Excessive trailing newline detected", normalize: false
|
||||||
expect_no_corrections s
|
expect_no_corrections source
|
||||||
end
|
end
|
||||||
|
|
||||||
it "fails if last line is not blank" do
|
it "fails if last line is not blank" do
|
||||||
s = expect_issue subject, "\n\n\n puts 22 # error: Trailing newline missing", normalize: false
|
source = expect_issue subject, "\n\n\n puts 22 # error: Trailing newline missing", normalize: false
|
||||||
expect_correction s, "\n\n\n puts 22\n"
|
expect_correction source, "\n\n\n puts 22\n"
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when unnecessary blank line has been detected" do
|
context "when unnecessary blank line has been detected" do
|
||||||
|
|
|
@ -7,12 +7,12 @@ module Ameba
|
||||||
it "transforms large number #{number}" do
|
it "transforms large number #{number}" do
|
||||||
rule = Rule::Style::LargeNumbers.new
|
rule = Rule::Style::LargeNumbers.new
|
||||||
|
|
||||||
s = expect_issue rule, <<-CRYSTAL, number: number
|
source = expect_issue rule, <<-CRYSTAL, number: number
|
||||||
number = %{number}
|
number = %{number}
|
||||||
# ^{number} error: Large numbers should be written with underscores: #{expected}
|
# ^{number} error: Large numbers should be written with underscores: #{expected}
|
||||||
CRYSTAL
|
CRYSTAL
|
||||||
|
|
||||||
expect_correction s, <<-CRYSTAL
|
expect_correction source, <<-CRYSTAL
|
||||||
number = #{expected}
|
number = #{expected}
|
||||||
CRYSTAL
|
CRYSTAL
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue