mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
20 lines
531 B
Crystal
20 lines
531 B
Crystal
require "../../../spec_helper"
|
|
|
|
module Ameba::Rule::Layout
|
|
subject = TrailingWhitespace.new
|
|
|
|
describe TrailingWhitespace do
|
|
it "passes if all lines do not have trailing whitespace" do
|
|
expect_no_issues subject, "no-whitespace"
|
|
end
|
|
|
|
it "fails if there is a line with trailing whitespace" do
|
|
source = expect_issue subject,
|
|
"whitespace at the end \n" \
|
|
" # ^^ error: Trailing whitespace detected"
|
|
|
|
expect_correction source, "whitespace at the end"
|
|
end
|
|
end
|
|
end
|