Sha256: 92809b0205246003cc64a18802524a0b50fb84753bfdc0032a3c5ccbde6e5260
Contents?: true
Size: 705 Bytes
Versions: 44
Compression:
Stored size: 705 Bytes
Contents
module Spout module Tests module JsonValidation def assert_valid_json(item, msg = nil) result = begin !!JSON.parse(File.read(item)) rescue JSON::ParserError => e error = e false end full_message = build_message(msg, "?", error) assert_block(full_message) do result end end Dir.glob("variables/**/*.json").each do |file| define_method("test_json: "+file) do assert_valid_json file end end Dir.glob("domains/**/*.json").each do |file| define_method("test_json: "+file) do assert_valid_json file end end end end end
Version data entries
44 entries across 44 versions & 1 rubygems