Sha256: 87609bcb3e964f4a84a2d9efcc26d188425303d67213c4122d981cc718829320
Contents?: true
Size: 657 Bytes
Versions: 3
Compression:
Stored size: 657 Bytes
Contents
# frozen_string_literal: true module Spout module Tests # Tests to assure that the variable name starts with a lowercase letter # followed by lowercase letters, numbers, or underscores module VariableNameFormat Dir.glob("variables/**/*.json").each do |file| define_method("test_variable_name_format: #{file}") do message = "Variable name format error. Name must start with a lowercase letter and be followed by lowercase letters, numbers, or underscores" assert_match(/^[a-z]\w*$/, (begin JSON.parse(File.read(file, encoding: "utf-8"))["id"] rescue nil end), message) end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
spout-1.0.0 | lib/spout/tests/variable_name_format.rb |
spout-1.0.0.beta3 | lib/spout/tests/variable_name_format.rb |
spout-1.0.0.beta2 | lib/spout/tests/variable_name_format.rb |