Sha256: e13678eef2a97f2786cd655a368ed98b3880222b6651bf3695ba0a8fa0325138
Contents?: true
Size: 821 Bytes
Versions: 8
Compression:
Stored size: 821 Bytes
Contents
module Spout module Tests module DomainExistenceValidation def assert_domain_existence(item, msg = nil) result = begin domain_name = JSON.parse(File.read(item))["domain"]+".json" File.exists?(File.join("domains", domain_name)) rescue JSON::ParserError false end full_message = build_message(msg, "The domain \"domains/#{domain_name}\" referenced by ? does not exist.", item) assert_block(full_message) do result end end Dir.glob("variables/**/*.json").each do |file| if (not [nil, ''].include?(JSON.parse(File.read(file))["domain"]) rescue false) define_method("test_domain_exists: "+file) do assert_domain_existence file end end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems