Class: AWSCDK::Assertions::MatchFailure
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Assertions::MatchFailure
- Defined in:
- assertions/match_failure.rb
Overview
Match failure details.
Instance Attribute Summary collapse
-
#cost ⇒ Numeric?
readonly
The cost of this particular mismatch.
-
#matcher ⇒ AWSCDK::Assertions::Matcher
readonly
The matcher that had the failure.
-
#message ⇒ String
readonly
Failure message.
-
#path ⇒ Array<String>
readonly
The relative path in the target where the failure occurred.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(matcher:, message:, path:, cost: nil) ⇒ MatchFailure
constructor
A new instance of MatchFailure.
- #to_jsii ⇒ Object
Constructor Details
#initialize(matcher:, message:, path:, cost: nil) ⇒ MatchFailure
Returns a new instance of MatchFailure.
11 12 13 14 15 16 17 18 19 20 |
# File 'assertions/match_failure.rb', line 11 def initialize(matcher:, message:, path:, cost: nil) @matcher = matcher Jsii::Type.check_type(@matcher, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hc3NlcnRpb25zLk1hdGNoZXIifQ==")), "matcher") @message = Jsii::Type.check_type(@message, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "message") @path = path Jsii::Type.check_type(@path, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "path") @cost = cost Jsii::Type.check_type(@cost, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "cost") unless @cost.nil? end |
Instance Attribute Details
#cost ⇒ Numeric? (readonly)
Note:
Default: 1
The cost of this particular mismatch.
42 43 44 |
# File 'assertions/match_failure.rb', line 42 def cost @cost end |
#matcher ⇒ AWSCDK::Assertions::Matcher (readonly)
The matcher that had the failure.
25 26 27 |
# File 'assertions/match_failure.rb', line 25 def matcher @matcher end |
#message ⇒ String (readonly)
Failure message.
29 30 31 |
# File 'assertions/match_failure.rb', line 29 def @message end |
#path ⇒ Array<String> (readonly)
The relative path in the target where the failure occurred.
If the failure occurred at root of the match tree, set the path to an empty list.
If it occurs in the 5th index of an array nested within the 'foo' key of an object,
set the path as ['/foo', '[5]'].
37 38 39 |
# File 'assertions/match_failure.rb', line 37 def path @path end |
Class Method Details
.jsii_properties ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'assertions/match_failure.rb', line 44 def self.jsii_properties { :matcher => "matcher", :message => "message", :path => "path", :cost => "cost", } end |
Instance Method Details
#to_jsii ⇒ Object
53 54 55 56 57 58 59 60 61 62 |
# File 'assertions/match_failure.rb', line 53 def to_jsii result = {} result.merge!({ "matcher" => @matcher, "message" => @message, "path" => @path, "cost" => @cost, }) result.compact end |