class Wrapture::InvalidSpecKey

The spec has a key that is not valid.

Public Class Methods

new(message, valid_keys: []) click to toggle source

Creates an InvalidSpecKey with the given message. A list of valid values may optionally be passed to valid_keys which will be added to the end of the message.

Calls superclass method
# File lib/wrapture/errors.rb, line 47
def initialize(message, valid_keys: [])
  complete_message = message.dup

  unless valid_keys.empty?
    complete_message << ' (valid values are \''
    complete_message << valid_keys.join('\', \'')
    complete_message << '\')'
  end

  super(complete_message)
end