Class: EacRubyUtils::Rspec::SetupManager

Inherits:
Object
  • Object
show all
Defined in:
lib/eac_ruby_utils/rspec/setup_manager.rb

Constant Summary collapse

GEMS_REGISTRY_SUFFIX =
'Rspec::Setup'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app_root_path, rspec_config) ⇒ SetupManager

Returns a new instance of SetupManager.



24
25
26
27
28
# File 'lib/eac_ruby_utils/rspec/setup_manager.rb', line 24

def initialize(app_root_path, rspec_config)
  @app_root_path = app_root_path.to_pathname
  @rspec_config = rspec_config
  include_registry
end

Instance Attribute Details

#app_root_pathObject (readonly)

Returns the value of attribute app_root_path.



22
23
24
# File 'lib/eac_ruby_utils/rspec/setup_manager.rb', line 22

def app_root_path
  @app_root_path
end

#rspec_configObject (readonly)

Returns the value of attribute rspec_config.



22
23
24
# File 'lib/eac_ruby_utils/rspec/setup_manager.rb', line 22

def rspec_config
  @rspec_config
end

Class Method Details

.create(app_root_path, rspec_config = nil) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/eac_ruby_utils/rspec/setup_manager.rb', line 13

def create(app_root_path, rspec_config = nil)
  if rspec_config
    new(app_root_path, rspec_config)
  else
    ::RSpec.configure { |new_rspec_config| new(app_root_path, new_rspec_config) }
  end
end

Instance Method Details

#gems_registryEacRubyUtils::GemsRegistry



31
32
33
# File 'lib/eac_ruby_utils/rspec/setup_manager.rb', line 31

def gems_registry
  @gems_registry ||= ::EacRubyUtils::GemsRegistry.new(GEMS_REGISTRY_SUFFIX)
end