Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b5c8cbc

Browse files
committed
Updated documentation.
1 parent 6bcfcf5 commit b5c8cbc

1 file changed

Lines changed: 35 additions & 3 deletions

File tree

docs/userguide/expectations.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Pseudo-code:
2323
All matchers have shortcuts like:
2424
```sql
2525
ut.expect( a_actual {data-type} ).to_{matcher};
26-
ut.expect( a_actual {data-type} ).not_to{matcher};
26+
ut.expect( a_actual {data-type} ).not_to_{matcher};
2727
```
2828

2929
# Matchers
@@ -50,6 +50,9 @@ Example:
5050
begin
5151
ut.expect( a_actual => 3 ).to_be_between( a_lower_bound => 1, a_upper_bound => 3 );
5252
ut.expect( 3 ).to_be_between( 1, 3 );
53+
--or
54+
ut.expect( a_actual => 3 ).to_( be_between( a_lower_bound => 1, a_upper_bound => 3 ) );
55+
ut.expect( 3 ).to_( be_between( 1, 3 ) );
5356
end;
5457
```
5558

@@ -63,6 +66,8 @@ procedure test_if_cursor_is_empty is
6366
begin
6467
open l_cursor for select * from dual where 1 = 0;
6568
ut.expect( l_cursor ).to_be_empty();
69+
--or
70+
ut.expect( l_cursor ).to_( be_empty() );
6671
end;
6772
```
6873

@@ -75,6 +80,8 @@ Usage:
7580
```sql
7681
begin
7782
ut.expect( ( 1 = 0 ) ).to_be_false();
83+
--or
84+
ut.expect( ( 1 = 0 ) ).to_( be_false() );
7885
end;
7986
```
8087

@@ -85,6 +92,8 @@ Usage:
8592
```sql
8693
begin
8794
ut.expect( sysdate ).to_be_greater_or_equal( sysdate - 1 );
95+
--or
96+
ut.expect( sysdate ).to_( be_greater_or_equal( sysdate - 1 ) );
8897
end;
8998
```
9099

@@ -95,6 +104,8 @@ Usage:
95104
```sql
96105
begin
97106
ut.expect( 2 ).to_be_greater_than( 1 );
107+
--or
108+
ut.expect( 2 ).to_( be_greater_than( 1 ) );
98109
end;
99110
```
100111

@@ -105,6 +116,8 @@ Usage:
105116
```sql
106117
begin
107118
ut.expect( 3 ).to_be_less_or_equal( 3 );
119+
--or
120+
ut.expect( 3 ).to_( be_less_or_equal( 3 ) );
108121
end;
109122
```
110123

@@ -115,6 +128,8 @@ Usage:
115128
```sql
116129
begin
117130
ut.expect( 3 ).to_be_less_than( 2 );
131+
--or
132+
ut.expect( 3 ).to_( be_less_than( 2 ) );
118133
end;
119134
```
120135

@@ -127,6 +142,9 @@ Usage:
127142
begin
128143
ut.expect( 'Lorem_impsum' ).to_be_like( a_mask => '%rem\_%', a_escape_char => '\' );
129144
ut.expect( 'Lorem_impsum' ).to_be_like( '%rem\_%', '\' );
145+
--or
146+
ut.expect( 'Lorem_impsum' ).to_( be_like( a_mask => '%rem\_%', a_escape_char => '\' ) );
147+
ut.expect( 'Lorem_impsum' ).to_( be_like( '%rem\_%', '\' ) );
130148
end;
131149
```
132150
@@ -140,6 +158,10 @@ Usage:
140158
```sql
141159
begin
142160
ut.expect( to_clob('ABC') ).to_be_not_null();
161+
--or
162+
ut.expect( to_clob('ABC') ).to_( be_not_null() );
163+
--or
164+
ut.expect( to_clob('ABC') ).not_to( be_null() );
143165
end;
144166
```
145167
@@ -150,6 +172,8 @@ Usage:
150172
```sql
151173
begin
152174
ut.expect( cast(null as varchar2(100)) ).to_be_null();
175+
--or
176+
ut.expect( cast(null as varchar2(100)) ).to_( be_null() );
153177
end;
154178
```
155179
@@ -161,6 +185,8 @@ Usage:
161185
```sql
162186
begin
163187
ut.expect( ( 1 = 1 ) ).to_be_true();
188+
--or
189+
ut.expect( ( 1 = 1 ) ).to_( be_true() );
164190
end;
165191
```
166192
@@ -179,6 +205,9 @@ procedure check_if_cursors_are_equal is
179205
begin
180206
ut.expect( 'a dog' ).to_equal( 'a dog' );
181207
ut.expect( a_actual => y ).to_equal( a_expected => x, a_nulls_are_equal => true );
208+
--or
209+
ut.expect( 'a dog' ).to_( equal( 'a dog' ) );
210+
ut.expect( a_actual => y ).to_( equal( a_expected => x, a_nulls_are_equal => true ) );
182211
end;
183212
```
184213
The `a_nulls_are_equal` parameter decides on the behavior of `null=null` comparison (**this comparison by default is true!**)
@@ -341,6 +370,9 @@ Usage:
341370
begin
342371
ut.expect( a_actual => '123-456-ABcd' ).to_match( a_pattern => '\d{3}-\d{3}-[a-z]', a_modifiers => 'i' );
343372
ut.expect( 'some value' ).to_match( '^some.*' );
373+
--or
374+
ut.expect( a_actual => '123-456-ABcd' ).to_( match( a_pattern => '\d{3}-\d{3}-[a-z]', a_modifiers => 'i' ) );
375+
ut.expect( 'some value' ).to_( match( '^some.*' ) );
344376
end;
345377
```
346378

@@ -377,7 +409,7 @@ Syntax of check for matcher evaluating to true:
377409
```sql
378410
begin
379411
ut.expect( a_actual {data-type} ).to_{matcher};
380-
ut.expect( a_actual {data-type} ).to_{ (matcher} );
412+
ut.expect( a_actual {data-type} ).to_( {matcher} );
381413
end;
382414
```
383415

@@ -394,7 +426,7 @@ If a matcher evaluated to NULL, then both `to_` and `not_to` will cause the expe
394426
Example:
395427
```sql
396428
begin
397-
ut.expect( null ).to_be_true();
429+
ut.expect( null ).to_( be_true() );
398430
ut.expect( null ).not_to( be_true() );
399431
end;
400432
```

0 commit comments

Comments
 (0)