Class: TestData::Configurators::SecretsYaml

Inherits:
Object
  • Object
show all
Defined in:
lib/test_data/configurators/secrets_yaml.rb

Instance Method Summary collapse

Constructor Details

#initializeSecretsYaml

Returns a new instance of SecretsYaml.



4
5
6
7
# File 'lib/test_data/configurators/secrets_yaml.rb', line 4

def initialize
  @generator = SecretsYamlGenerator.new
  @config = TestData.config
end

Instance Method Details

#configureObject



20
21
22
# File 'lib/test_data/configurators/secrets_yaml.rb', line 20

def configure
  @generator.call
end

#verifyObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/test_data/configurators/secrets_yaml.rb', line 9

def verify
  if !File.exist?(@config.secrets_yaml_full_path) ||
      YAML.load_file(@config.secrets_yaml_full_path).key?("test_data")
    ConfigurationVerification.new(looks_good?: true)
  else
    ConfigurationVerification.new(problems: [
      "'#{@config.secrets_yaml_path}' exists but does not contain a 'test_data' section"
    ])
  end
end