Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Sija authored Dec 28, 2024
1 parent 79af08e commit 9a31634
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,16 @@ require "../../../spec_helper"
module Ameba::Rule::Typing
subject = ProcLiteralReturnTypeRestriction.new

it "passes if a proc literal has a return type" do
it "passes if a proc literal has a return type restriction" do
expect_no_issues subject, <<-CRYSTAL
my_proc = ->(var : String) : Nil { puts var }
my_proc.call(nil)
CRYSTAL
end

it "fails if a proc literal doesn't have a return type" do
it "fails if a proc literal doesn't have a return type restriction" do
expect_issue subject, <<-CRYSTAL
my_proc = ->(var : String) { puts var }
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: Proc literal should have a return type restriction
my_proc.call(nil)
CRYSTAL
end
end

0 comments on commit 9a31634

Please sign in to comment.