Method: FeatureMap::Private::TestPyramidFile.load_features!

Defined in:
lib/feature_map/private/test_pyramid_file.rb

.load_features!Object



84
85
86
87
88
89
90
91
92
93
94
# File 'lib/feature_map/private/test_pyramid_file.rb', line 84

def self.load_features!
  test_coverage_content = YAML.load_file(path)

  return test_coverage_content[FEATURES_KEY] if test_coverage_content.is_a?(Hash) && test_coverage_content[FEATURES_KEY]

  raise FileContentError, "Unexpected content found in #{path}. Use `bin/featuremap test_coverage` to regenerate it and try again."
rescue Psych::SyntaxError => e
  raise FileContentError, "Invalid YAML content found at #{path}. Error: #{e.message} Use `bin/featuremap test_coverage` to generate it and try again."
rescue Errno::ENOENT
  raise FileContentError, "No feature test coverage file found at #{path}. Use `bin/featuremap test_coverage` to generate it and try again."
end