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'
REGISTERED_MODULE_PERFORM_METHOD =
:perform

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.



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

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.



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

def app_root_path
  @app_root_path
end

#rspec_configObject (readonly)

Returns the value of attribute rspec_config.



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

def rspec_config
  @rspec_config
end

Class Method Details

.create(app_root_path, rspec_config = nil) ⇒ Object



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

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

Returns:



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

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