From 30582f9a89cfba92ae9da1e78948939bcc2b760e Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Sat, 26 Jan 2019 17:04:46 -0700 Subject: [PATCH] Add empty matcher to DSL --- src/spectator/dsl/matcher_dsl.cr | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/spectator/dsl/matcher_dsl.cr b/src/spectator/dsl/matcher_dsl.cr index 972898e..acfff61 100644 --- a/src/spectator/dsl/matcher_dsl.cr +++ b/src/spectator/dsl/matcher_dsl.cr @@ -273,5 +273,15 @@ module Spectator::DSL macro be_nil ::Spectator::Matchers::NilMatcher.new end + + # Indicates that some collection should be empty. + # + # Example: + # ``` + # expect([]).to be_empty + # ``` + macro be_empty + ::Spectator::Matchers::EmptyMatcher.new + end end end