From 9a316346849fab16b2c537c98fdf36bb90daf801 Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Sat, 28 Dec 2024 23:56:28 +0100 Subject: [PATCH] Apply suggestions from code review --- .../typing/proc_literal_return_type_restriction_spec.cr | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/spec/ameba/rule/typing/proc_literal_return_type_restriction_spec.cr b/spec/ameba/rule/typing/proc_literal_return_type_restriction_spec.cr index 6ad5c264b..dacb4da1d 100644 --- a/spec/ameba/rule/typing/proc_literal_return_type_restriction_spec.cr +++ b/spec/ameba/rule/typing/proc_literal_return_type_restriction_spec.cr @@ -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