Class: TestData::Configurators::EnvironmentFile

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

Instance Method Summary collapse

Constructor Details

#initializeEnvironmentFile

Returns a new instance of EnvironmentFile.



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

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

Instance Method Details

#configureObject



21
22
23
# File 'lib/test_data/configurators/environment_file.rb', line 21

def configure
  @generator.call
end

#verifyObject



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

def verify
  path = "config/environments/test_data.rb"
  pathname = Pathname.new("#{@config.pwd}/#{path}")
  if pathname.readable?
    ConfigurationVerification.new(looks_good?: true)
  else
    ConfigurationVerification.new(problems: [
      "'#{path}' is not readable"
    ])
  end
end