Remove normalize parameter from expect_issue (#249)

* Add `normalize` parameter to `expect_correction`

* Convert Style/IsAFilter spec

* Revert "Add `normalize` parameter to `expect_correction`"

This reverts commit 4b67e4b900.

* Remove `normalize` parameter from `expect_issue`

* Require indentation if multiple issues on a single line

* Update `Style/IsAFilter` spec

* Update `ExpectIssue` documentation

* Add missing `expect_no_corrections`

* Use carets and space with issues at column 1 or 2

* Update `expect_issue` docs
This commit is contained in:
fn ⌃ ⌥ 2021-11-06 06:15:19 -07:00 committed by GitHub
parent 7cb0c15747
commit 7b437fbd2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 182 additions and 103 deletions

View file

@ -5,7 +5,7 @@ module Ameba::Rule::Layout
describe TrailingBlankLines do
it "passes if there is a blank line at the end of a source" do
expect_no_issues subject, "a = 1\n", normalize: false
expect_no_issues subject, "a = 1\n"
end
it "passes if source is empty" do
@ -18,12 +18,12 @@ module Ameba::Rule::Layout
end
it "fails if there more then one blank line at the end of a source" do
source = 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"
expect_no_corrections source
end
it "fails if last line is not blank" do
source = 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"
expect_correction source, "\n\n\n puts 22\n"
end