@@ -136,6 +136,7 @@ utPLSQL provides the following matchers to perform checks on the expected and ac
136136- ` be_null `
137137- ` be_true `
138138- ` equal `
139+ - ` have_count `
139140- ` match `
140141
141142## be_between
@@ -288,6 +289,23 @@ begin
288289end;
289290```
290291
292+ ## have_count
293+ Unary matcher that validates if the provided dataset count is equal to expected value.
294+
295+ Can be used with ` refcursor ` or ` table type `
296+
297+ Usage:
298+ ``` sql
299+ procedure test_if_cursor_is_empty is
300+ l_cursor sys_refcursor;
301+ begin
302+ open l_cursor for select * from dual connect by level <= 10 ;
303+ ut .expect ( l_cursor ).to_have_count(10 );
304+ -- or
305+ ut .expect ( l_cursor ).to_( have_count(10 ) );
306+ end;
307+ ```
308+
291309## match
292310Validates that the actual value is matching the expected regular expression.
293311
@@ -649,21 +667,21 @@ Since NULL is neither *true* nor *false*, both expectations will report failure.
649667
650668The matrix below illustrates the data types supported by different matchers.
651669
652- | | be_between | be_empty | be_false | be_greater_than | be_greater_or_equal | be_less_or_equal | be_less_than | be_like | be_not_null | be_null | be_true | equal | match |
653- | :------------------------------| :----------:| :--------:| :--------:| :---------------:| :-------------------:| :----------------:| :------------:| :-------:| :-----------:| :-------:| :-------:| :-----:| :-----:|
654- | anydata( collection, object ) | | X | | | | | | | X | X | | X | |
655- | blob | | | | | | | | | X | X | | X | |
656- | boolean | | | X | | | | | | X | X | X | X | |
657- | clob | | | | | | | | X | X | X | | X | X |
658- | date | X | | | X | X | X | X | | X | X | | X | |
659- | number | X | | | X | X | X | X | | X | X | | X | |
660- | refcursor | | X | | | | | | | X | X | | X | |
661- | timestamp | X | | | X | X | X | X | | X | X | | X | |
662- | timestamp with timezone | X | | | X | X | X | X | | X | X | | X | |
663- | timestamp with local timezone | X | | | X | X | X | X | | X | X | | X | |
664- | varchar2 | X | | | | | | | X | X | X | | X | X |
665- | interval year to month | X | | | X | X | X | X | | X | X | | X | |
666- | interval day to second | X | | | X | X | X | X | | X | X | | X | |
670+ | | be_between | be_empty | be_false | be_greater_than | be_greater_or_equal | be_less_or_equal | be_less_than | be_like | be_not_null | be_null | be_true | equal | have_count | match |
671+ | :------------------------------| :----------:| :--------:| :--------:| :---------------:| :-------------------:| :----------------:| :------------:| :-------:| :-----------:| :-------:| :-------:| :-----:| :----------: | :----- :|
672+ | anydata( collection, object ) | | X | | | | | | | X | X | | X | X | |
673+ | blob | | | | | | | | | X | X | | X | | |
674+ | boolean | | | X | | | | | | X | X | X | X | | |
675+ | clob | | | | | | | | X | X | X | | X | | X |
676+ | date | X | | | X | X | X | X | | X | X | | X | | |
677+ | number | X | | | X | X | X | X | | X | X | | X | | |
678+ | refcursor | | X | | | | | | | X | X | | X | X | |
679+ | timestamp | X | | | X | X | X | X | | X | X | | X | | |
680+ | timestamp with timezone | X | | | X | X | X | X | | X | X | | X | | |
681+ | timestamp with local timezone | X | | | X | X | X | X | | X | X | | X | | |
682+ | varchar2 | X | | | | | | | X | X | X | | X | | X |
683+ | interval year to month | X | | | X | X | X | X | | X | X | | X | | |
684+ | interval day to second | X | | | X | X | X | X | | X | X | | X | | |
667685
668686
669687
0 commit comments