Class: RSpec::Terraform::Matchers::IncludeOutputChange

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/terraform/matchers/include_output_change.rb

Overview

rubocop:disable Metrics/ClassLength

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(definition = {}) ⇒ IncludeOutputChange

Returns a new instance of IncludeOutputChange.



10
11
12
13
# File 'lib/rspec/terraform/matchers/include_output_change.rb', line 10

def initialize(definition = {})
  @definition = definition
  @value = nil
end

Instance Attribute Details

#definitionObject (readonly)

Returns the value of attribute definition.



8
9
10
# File 'lib/rspec/terraform/matchers/include_output_change.rb', line 8

def definition
  @definition
end

#planObject (readonly)

Returns the value of attribute plan.



8
9
10
# File 'lib/rspec/terraform/matchers/include_output_change.rb', line 8

def plan
  @plan
end

#valueObject (readonly)

Returns the value of attribute value.



8
9
10
# File 'lib/rspec/terraform/matchers/include_output_change.rb', line 8

def value
  @value
end

Instance Method Details

#failure_messageObject



26
27
28
29
# File 'lib/rspec/terraform/matchers/include_output_change.rb', line 26

def failure_message
  "\nexpected: #{positive_expected_line}" \
    "\n     got: #{positive_got_line}"
end

#matches?(plan) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
18
19
# File 'lib/rspec/terraform/matchers/include_output_change.rb', line 15

def matches?(plan)
  @plan = plan

  !value_matches(plan).empty?
end

#with_value(value) ⇒ Object



21
22
23
24
# File 'lib/rspec/terraform/matchers/include_output_change.rb', line 21

def with_value(value)
  @value = maybe_box_value(value)
  self
end