Class: RightDevelop::Testing::Recording::Metadata::MissingVariableFailure

Inherits:
RetryableFailure
  • Object
show all
Defined in:
lib/right_develop/testing/recording/metadata.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ MissingVariableFailure

Returns a new instance of MissingVariableFailure.



64
65
66
67
68
69
# File 'lib/right_develop/testing/recording/metadata.rb', line 64

def initialize(options)
  @path = options[:path] or raise ::ArgumentError, 'options[:path] is required'
  @variable = options[:variable] or raise ::ArgumentError, 'options[:variable] is required'
  @variable_array_index = options[:variable_array_index] || 0
  @variable_array_size = options[:variable_array_size] || 0
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



62
63
64
# File 'lib/right_develop/testing/recording/metadata.rb', line 62

def path
  @path
end

#variableObject (readonly)

Returns the value of attribute variable.



62
63
64
# File 'lib/right_develop/testing/recording/metadata.rb', line 62

def variable
  @variable
end

#variable_array_indexObject (readonly)

Returns the value of attribute variable_array_index.



62
63
64
# File 'lib/right_develop/testing/recording/metadata.rb', line 62

def variable_array_index
  @variable_array_index
end

#variable_array_sizeObject (readonly)

Returns the value of attribute variable_array_size.



62
63
64
# File 'lib/right_develop/testing/recording/metadata.rb', line 62

def variable_array_size
  @variable_array_size
end

Instance Method Details

#messageObject



71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/right_develop/testing/recording/metadata.rb', line 71

def message
  if (0 == variable_array_size)
    result = 'A variable was never defined by request '
  else
    result =
      'A variable index is past the range of values defined by request ' <<
      "(#{variable_array_index} >= #{variable_array_size}) "
  end
  result <<
    "while replacing variable = #{variable.inspect} at " <<
    path.join('/').inspect
end