Method: Inspec::Resources::JsonConfig#method_missing

Defined in:
lib/resources/json.rb

#method_missing(*keys) ⇒ Object

Shorthand to retrieve a parameter name via ‘#its`. Example: describe json(’file’) { its(‘paramX’) { should eq ‘Y’ } }

Parameters:

  • name (String)

    name of the field to retrieve

Returns:

  • (Object)

    the value stored at this position



49
50
51
52
53
54
# File 'lib/resources/json.rb', line 49

def method_missing(*keys)
  # catch bahavior of rspec its implementation
  # @see https://github.com/rspec/rspec-its/blob/master/lib/rspec/its.rb#L110
  keys.shift if keys.is_a?(Array) && keys[0] == :[]
  value(keys)
end