9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/test_data/configurators/webpacker_yaml.rb', line 9
def verify
if @webpacker_config.no_user_config_exists?
ConfigurationVerification.new(looks_good?: true)
elsif (user_config = @webpacker_config.user_config).nil?
ConfigurationVerification.new(problems: [
"`#{@webpacker_config.relative_user_config_path}' is not valid YAML"
])
elsif !user_config.key?("test_data")
ConfigurationVerification.new(problems: [
"`#{@webpacker_config.relative_user_config_path}' does not contain a `test_data' section"
])
elsif (entries = @webpacker_config.required_entries_missing_from_test_data_config)
ConfigurationVerification.new(problems: [
"`#{@webpacker_config.relative_user_config_path}' is missing #{"entry".pluralize(entries.size)} #{entries.map { |(k, v)| "`#{k}' (default: #{v.inspect})" }.join(", ")} in its `test_data' section"
])
else
ConfigurationVerification.new(looks_good?: true)
end
end
|