Class: AWSCDK::Assertions::Match

Inherits:
Jsii::Object
  • Object
show all
Defined in:
assertions/match.rb

Overview

Partial and special matching during template assertions.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMatch

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.

Parameters:

  • pattern (Object)

    the pattern to NOT match.

Returns:



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

.absentAWSCDK::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_valueAWSCDK::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.

Parameters:

  • pattern (Array<Object>)

    the pattern to match.

Returns:



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.

Parameters:

  • pattern (Array<Object>)

    the pattern to match.

Returns:



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.

Parameters:

  • pattern (Object)

    the pattern to match.

Returns:



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_methodsObject



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.

Parameters:

  • pattern (Hash{String => Object})

    the pattern to match.

Returns:



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.

Parameters:

  • pattern (Hash{String => Object})

    the pattern to match.

Returns:



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.

Parameters:

  • pattern (Object)

    the pattern to match after parsing the encoded JSON.

Returns:



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.

Parameters:

  • pattern (String)

Returns:



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