Class: AWSCDK::Assertions::Match
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::Assertions::Match
- Defined in:
- assertions/match.rb
Overview
Partial and special matching during template assertions.
Class Method Summary collapse
-
._not(pattern) ⇒ AWSCDK::Assertions::Matcher
Matches any target which does NOT follow the specified pattern.
-
.absent ⇒ AWSCDK::Assertions::Matcher
Use this matcher in the place of a field's value, if the field must not be present.
-
.any_value ⇒ AWSCDK::Assertions::Matcher
Matches any non-null value at the target.
-
.array_equals(pattern) ⇒ AWSCDK::Assertions::Matcher
Matches the specified pattern with the array found in the same relative path of the target.
-
.array_with(pattern) ⇒ AWSCDK::Assertions::Matcher
Matches the specified pattern with the array found in the same relative path of the target.
-
.exact(pattern) ⇒ AWSCDK::Assertions::Matcher
Deep exact matching of the specified pattern to the target.
- .jsii_overridable_methods ⇒ Object
-
.object_equals(pattern) ⇒ AWSCDK::Assertions::Matcher
Matches the specified pattern to an object found in the same relative path of the target.
-
.object_like(pattern) ⇒ AWSCDK::Assertions::Matcher
Matches the specified pattern to an object found in the same relative path of the target.
-
.serialized_json(pattern) ⇒ AWSCDK::Assertions::Matcher
Matches any string-encoded JSON and applies the specified pattern after parsing it.
-
.string_like_regexp(pattern) ⇒ AWSCDK::Assertions::Matcher
Matches targets according to a regular expression.
Instance Method Summary collapse
-
#initialize ⇒ Match
constructor
A new instance of Match.
Constructor Details
#initialize ⇒ Match
Returns a new instance of Match.
8 9 10 |
# File 'assertions/match.rb', line 8 def initialize Jsii::Object.instance_method(:initialize).bind(self).call end |
Class Method Details
._not(pattern) ⇒ AWSCDK::Assertions::Matcher
Matches any target which does NOT follow the specified pattern.
66 67 68 69 |
# File 'assertions/match.rb', line 66 def self._not(pattern) Jsii::Type.check_type(pattern, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "pattern") Jsii::Kernel.instance.call_static("aws-cdk-lib.assertions.Match", "not", [pattern]) end |
.absent ⇒ AWSCDK::Assertions::Matcher
Use this matcher in the place of a field's value, if the field must not be present.
20 21 22 |
# File 'assertions/match.rb', line 20 def self.absent() Jsii::Kernel.instance.call_static("aws-cdk-lib.assertions.Match", "absent", []) end |
.any_value ⇒ AWSCDK::Assertions::Matcher
Matches any non-null value at the target.
27 28 29 |
# File 'assertions/match.rb', line 27 def self.any_value() Jsii::Kernel.instance.call_static("aws-cdk-lib.assertions.Match", "anyValue", []) end |
.array_equals(pattern) ⇒ AWSCDK::Assertions::Matcher
Matches the specified pattern with the array found in the same relative path of the target.
The set of elements (or matchers) must match exactly and in order.
37 38 39 40 |
# File 'assertions/match.rb', line 37 def self.array_equals(pattern) Jsii::Type.check_type(pattern, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoiYXJyYXkifX0=")), "pattern") Jsii::Kernel.instance.call_static("aws-cdk-lib.assertions.Match", "arrayEquals", [pattern]) end |
.array_with(pattern) ⇒ AWSCDK::Assertions::Matcher
Matches the specified pattern with the array found in the same relative path of the target.
The set of elements (or matchers) must be in the same order as would be found.
48 49 50 51 |
# File 'assertions/match.rb', line 48 def self.array_with(pattern) Jsii::Type.check_type(pattern, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoiYXJyYXkifX0=")), "pattern") Jsii::Kernel.instance.call_static("aws-cdk-lib.assertions.Match", "arrayWith", [pattern]) end |
.exact(pattern) ⇒ AWSCDK::Assertions::Matcher
Deep exact matching of the specified pattern to the target.
57 58 59 60 |
# File 'assertions/match.rb', line 57 def self.exact(pattern) Jsii::Type.check_type(pattern, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "pattern") Jsii::Kernel.instance.call_static("aws-cdk-lib.assertions.Match", "exact", [pattern]) end |
.jsii_overridable_methods ⇒ Object
12 13 14 15 |
# File 'assertions/match.rb', line 12 def self.jsii_overridable_methods { } end |
.object_equals(pattern) ⇒ AWSCDK::Assertions::Matcher
Matches the specified pattern to an object found in the same relative path of the target.
The keys and their values (or matchers) must match exactly with the target.
77 78 79 80 |
# File 'assertions/match.rb', line 77 def self.object_equals(pattern) Jsii::Type.check_type(pattern, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoibWFwIn19")), "pattern") Jsii::Kernel.instance.call_static("aws-cdk-lib.assertions.Match", "objectEquals", [pattern]) end |
.object_like(pattern) ⇒ AWSCDK::Assertions::Matcher
Matches the specified pattern to an object found in the same relative path of the target.
The keys and their values (or matchers) must be present in the target but the target can be a superset.
88 89 90 91 |
# File 'assertions/match.rb', line 88 def self.object_like(pattern) Jsii::Type.check_type(pattern, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImFueSJ9LCJraW5kIjoibWFwIn19")), "pattern") Jsii::Kernel.instance.call_static("aws-cdk-lib.assertions.Match", "objectLike", [pattern]) end |
.serialized_json(pattern) ⇒ AWSCDK::Assertions::Matcher
Matches any string-encoded JSON and applies the specified pattern after parsing it.
97 98 99 100 |
# File 'assertions/match.rb', line 97 def self.serialized_json(pattern) Jsii::Type.check_type(pattern, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "pattern") Jsii::Kernel.instance.call_static("aws-cdk-lib.assertions.Match", "serializedJson", [pattern]) end |
.string_like_regexp(pattern) ⇒ AWSCDK::Assertions::Matcher
Matches targets according to a regular expression.
106 107 108 109 |
# File 'assertions/match.rb', line 106 def self.string_like_regexp(pattern) Jsii::Type.check_type(pattern, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "pattern") Jsii::Kernel.instance.call_static("aws-cdk-lib.assertions.Match", "stringLikeRegexp", [pattern]) end |