From 98b29cad19ddd7b6083080b0699bdf0f52b93b74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Tue, 20 Jul 2021 17:32:56 +0200 Subject: [PATCH] Add default value for `description` in `Spec::Methods#describe` and `context` --- src/spec/methods.cr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spec/methods.cr b/src/spec/methods.cr index ebde51f7023a..43bc91d88821 100644 --- a/src/spec/methods.cr +++ b/src/spec/methods.cr @@ -16,7 +16,7 @@ module Spec::Methods # ``` # # If `focus` is `true`, only this `describe`, and others marked with `focus: true`, will run. - def describe(description, file = __FILE__, line = __LINE__, end_line = __END_LINE__, focus : Bool = false, tags : String | Enumerable(String) | Nil = nil, &block) + def describe(description = nil, file = __FILE__, line = __LINE__, end_line = __END_LINE__, focus : Bool = false, tags : String | Enumerable(String) | Nil = nil, &block) Spec.root_context.describe(description.to_s, file, line, end_line, focus, tags, &block) end @@ -27,7 +27,7 @@ module Spec::Methods # It is functionally equivalent to `#describe`. # # If `focus` is `true`, only this `context`, and others marked with `focus: true`, will run. - def context(description, file = __FILE__, line = __LINE__, end_line = __END_LINE__, focus : Bool = false, tags : String | Enumerable(String) | Nil = nil, &block) + def context(description = nil, file = __FILE__, line = __LINE__, end_line = __END_LINE__, focus : Bool = false, tags : String | Enumerable(String) | Nil = nil, &block) describe(description.to_s, file, line, end_line, focus, tags, &block) end