Skip to content

Commit

Permalink
Merge pull request #356 from crystal-ameba/chore/crystal-nightly
Browse files Browse the repository at this point in the history
chore: fix crystal-nightly compatibility
  • Loading branch information
veelenga authored Feb 19, 2023
2 parents 801affc + d03f058 commit 81177dc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion spec/ameba/severity_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 6 additions & 10 deletions src/ameba/rule/lint/missing_block_argument.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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:
#
Expand Down
2 changes: 1 addition & 1 deletion src/ameba/severity.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 81177dc

Please sign in to comment.