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.



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

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.



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

def path
  @path
end

#variableObject (readonly)

Returns the value of attribute variable.



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

def variable
  @variable
end

#variable_array_indexObject (readonly)

Returns the value of attribute variable_array_index.



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

def variable_array_index
  @variable_array_index
end

#variable_array_sizeObject (readonly)

Returns the value of attribute variable_array_size.



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

def variable_array_size
  @variable_array_size
end

Instance Method Details

#messageObject



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

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