Sha256: 9bdb3f494b91a4f4de50f8fad68d255400aa00e88273b3b5f676ca5d734bb975
Contents?: true
Size: 642 Bytes
Versions: 33
Compression:
Stored size: 642 Bytes
Contents
module Spout module Tests module VariableTypeValidation VALID_VARIABLE_TYPES = ['identifier', 'choices', 'integer', 'numeric', 'string', 'text', 'date', 'time', 'file', 'datetime'].sort def assert_variable_type(item) message = "#{item} invalid variable type. Valid types: #{VALID_VARIABLE_TYPES.join(', ')}" assert VALID_VARIABLE_TYPES.include?(item), message end Dir.glob("variables/**/*.json").each do |file| define_method("test_variable_type: "+file) do assert_variable_type begin JSON.parse(File.read(file))["type"] rescue nil end end end end end end
Version data entries
33 entries across 33 versions & 1 rubygems