Merge pull request #356 from crystal-ameba/chore/crystal-nightly

chore: fix crystal-nightly compatibility
This commit is contained in:
Vitalii Elenhaupt 2023-02-19 18:06:31 +02:00 committed by GitHub
commit 81177dc7e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 12 deletions

View file

@ -34,7 +34,7 @@ module Ameba
end
it "raises when name is incorrect" do
expect_raises(Exception, "Incorrect severity name BadName. Try one of [Error, Warning, Convention]") do
expect_raises(Exception, "Incorrect severity name BadName. Try one of: Error, Warning, Convention") do
Severity.parse("BadName")
end
end

View file

@ -3,19 +3,15 @@ module Ameba::Rule::Lint
#
# For example, this is considered invalid:
#
# ```
# def foo
# yield 42
# end
# ```
# def foo
# yield 42
# end
#
# And has to be written as the following:
#
# ```
# def foo(&)
# yield 42
# end
# ```
# def foo(&)
# yield 42
# end
#
# YAML configuration example:
#

View file

@ -41,7 +41,7 @@ module Ameba
def self.parse(name : String)
super name
rescue ArgumentError
raise "Incorrect severity name #{name}. Try one of #{values}"
raise "Incorrect severity name #{name}. Try one of: #{values.map(&.to_s).join(", ")}"
end
end