@@ -27,62 +27,57 @@ import (
27
27
var _ = Describe ("RequiresExactMatch function" , func () {
28
28
29
29
It ("Returns false when the selector matches everything" , func () {
30
- _ , _ , requiresExactMatch := RequiresExactMatch (fields .Everything ())
30
+ _ , requiresExactMatch := RequiresExactMatch (fields .Everything ())
31
31
Expect (requiresExactMatch ).To (BeFalse ())
32
32
})
33
33
34
34
It ("Returns false when the selector matches nothing" , func () {
35
- _ , _ , requiresExactMatch := RequiresExactMatch (fields .Nothing ())
35
+ _ , requiresExactMatch := RequiresExactMatch (fields .Nothing ())
36
36
Expect (requiresExactMatch ).To (BeFalse ())
37
37
})
38
38
39
39
It ("Returns false when the selector has the form key!=val" , func () {
40
- _ , _ , requiresExactMatch := RequiresExactMatch (fields .ParseSelectorOrDie ("key!=val" ))
40
+ _ , requiresExactMatch := RequiresExactMatch (fields .ParseSelectorOrDie ("key!=val" ))
41
41
Expect (requiresExactMatch ).To (BeFalse ())
42
42
})
43
43
44
- It ("Returns false when the selector has the form key1==val1,key2==val2" , func () {
45
- _ , _ , requiresExactMatch := RequiresExactMatch (fields .ParseSelectorOrDie ("key1==val1,key2==val2" ))
46
- Expect (requiresExactMatch ).To (BeFalse ())
44
+ It ("Returns true when the selector has the form key1==val1,key2==val2" , func () {
45
+ _ , requiresExactMatch := RequiresExactMatch (fields .ParseSelectorOrDie ("key1==val1,key2==val2" ))
46
+ Expect (requiresExactMatch ).To (BeTrue ())
47
47
})
48
48
49
49
It ("Returns true when the selector has the form key==val" , func () {
50
- _ , _ , requiresExactMatch := RequiresExactMatch (fields .ParseSelectorOrDie ("key==val" ))
50
+ _ , requiresExactMatch := RequiresExactMatch (fields .ParseSelectorOrDie ("key==val" ))
51
51
Expect (requiresExactMatch ).To (BeTrue ())
52
52
})
53
53
54
54
It ("Returns true when the selector has the form key=val" , func () {
55
- _ , _ , requiresExactMatch := RequiresExactMatch (fields .ParseSelectorOrDie ("key=val" ))
55
+ _ , requiresExactMatch := RequiresExactMatch (fields .ParseSelectorOrDie ("key=val" ))
56
56
Expect (requiresExactMatch ).To (BeTrue ())
57
57
})
58
58
59
59
It ("Returns empty key and value when the selector matches everything" , func () {
60
- key , val , _ := RequiresExactMatch (fields .Everything ())
61
- Expect (key ).To (Equal ("" ))
62
- Expect (val ).To (Equal ("" ))
60
+ requires , _ := RequiresExactMatch (fields .Everything ())
61
+ Expect (requires ).To (BeNil ())
63
62
})
64
63
65
64
It ("Returns empty key and value when the selector matches nothing" , func () {
66
- key , val , _ := RequiresExactMatch (fields .Nothing ())
67
- Expect (key ).To (Equal ("" ))
68
- Expect (val ).To (Equal ("" ))
65
+ requires , _ := RequiresExactMatch (fields .Nothing ())
66
+ Expect (requires ).To (BeNil ())
69
67
})
70
68
71
69
It ("Returns empty key and value when the selector has the form key!=val" , func () {
72
- key , val , _ := RequiresExactMatch (fields .ParseSelectorOrDie ("key!=val" ))
73
- Expect (key ).To (Equal ("" ))
74
- Expect (val ).To (Equal ("" ))
70
+ requires , _ := RequiresExactMatch (fields .ParseSelectorOrDie ("key!=val" ))
71
+ Expect (requires ).To (BeNil ())
75
72
})
76
73
77
74
It ("Returns key and value when the selector has the form key==val" , func () {
78
- key , val , _ := RequiresExactMatch (fields .ParseSelectorOrDie ("key==val" ))
79
- Expect (key ).To (Equal ("key" ))
80
- Expect (val ).To (Equal ("val" ))
75
+ requires , _ := RequiresExactMatch (fields .ParseSelectorOrDie ("key==val" ))
76
+ Expect (requires ).To (HaveKeyWithValue ("key" , "val" ))
81
77
})
82
78
83
79
It ("Returns key and value when the selector has the form key=val" , func () {
84
- key , val , _ := RequiresExactMatch (fields .ParseSelectorOrDie ("key=val" ))
85
- Expect (key ).To (Equal ("key" ))
86
- Expect (val ).To (Equal ("val" ))
80
+ requires , _ := RequiresExactMatch (fields .ParseSelectorOrDie ("key=val" ))
81
+ Expect (requires ).To (HaveKeyWithValue ("key" , "val" ))
87
82
})
88
83
})
0 commit comments