-
Notifications
You must be signed in to change notification settings - Fork 0
/
strings.feature
70 lines (67 loc) · 1.16 KB
/
strings.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Feature: String validation
Scenario: "type: string" should accept strings
Given a YAML schema:
```
type: string
```
Then it should accept:
```
"Déjà vu"
```
And it should accept:
```
""
```
And it should accept:
```
"42"
```
But it should NOT accept:
```
42
```
Scenario: length validation
Given a YAML schema:
```
type: string
minLength: 2
maxLength: 3
```
Then it should NOT accept:
```
"A"
```
But it should accept:
```
"AB"
```
And it should accept:
```
"ABC"
```
But it should NOT accept:
```
"ABCD"
```
Scenario: pattern validation
Given a YAML schema:
```
type: string
pattern: "^(\\([0-9]{3}\\))?[0-9]{3}-[0-9]{4}$"
```
Then it should accept:
```
"555-1212"
```
And it should accept:
```
"(888)555-1212"
```
But it should NOT accept:
```
"(888)555-1212 ext. 532"
```
And it should NOT accept:
```
"(800)FLOWERS"
```