Skip to content

Commit 27a0b44

Browse files
Merge pull request #49 from bats-core/#48
#48 Resource Type Pattern does not match Ec2NodeClass
2 parents cc98de0 + 114b6ff commit 27a0b44

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

lib/utils.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash
22

33
# The pattern for resource types
4-
# (pod, PODs, complex.crd.resource, etc.)
5-
resource_type_pattern="[a-z][a-z.]+"
4+
# (pod, PODs, complex.crd.resource, ec2nodeclass, etc.)
5+
resource_type_pattern="[a-z][0-9a-z.]+"
66

77
# The regex for the "try" key word
88
try_regex_verify_is="^at +most +([0-9]+) +times +every +([0-9]+)s +to +get +($resource_type_pattern) +named +'([^']+)' +and +verify +that +'([^']+)' +is +'([^']+)'$"

tests/test.detik.verify.bats

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,3 +677,12 @@ mytest_with_namespace() {
677677
[ "${lines[0]}" = "Valid expression. Verification in progress..." ]
678678
[ "${lines[1]}" = "Found 2 pods named nginx (instead of less than 1 expected)." ]
679679
}
680+
681+
682+
@test "verifying the number of ec2nodeclass with the lower-case syntax (resource name with a number)" {
683+
run verify "there are 2 ec2nodeclass named 'nginx'"
684+
[ "$status" -eq 0 ]
685+
[ ${#lines[@]} -eq 2 ]
686+
[ "${lines[0]}" = "Valid expression. Verification in progress..." ]
687+
[ "${lines[1]}" = "Found 2 ec2nodeclass named nginx (as expected)." ]
688+
}

0 commit comments

Comments
 (0)