Class: TestData::Configurators::Initializer

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

Instance Method Summary collapse

Constructor Details

#initializeInitializer

Returns a new instance of Initializer.



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

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

Instance Method Details

#configureObject



21
22
23
# File 'lib/test_data/configurators/initializer.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/initializer.rb', line 9

def verify
  path = "config/initializers/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