Class: ActiveMocker::LoadedMocks

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/active_mocker/loaded_mocks.rb,
lib/active_mocker/loaded_mocks/features.rb

Defined Under Namespace

Classes: Collection, Features

Class Method Summary collapse

Class Method Details

.featuresObject



30
31
32
# File 'lib/active_mocker/loaded_mocks.rb', line 30

def features
  @features ||= Features.instance
end

.mocksObject Also known as: class_name_to_mock, all

Returns an Enumerable of all currently loaded mocks.

ActiveMocker::LoadedMocks.mocks
    => <Collection @hash: {'Person' => PersonMock}>

Returns:

  • ActiveMocker::LoadedMocks::Collection



15
16
17
18
19
# File 'lib/active_mocker/loaded_mocks.rb', line 15

def mocks
  Collection.new(mocks_store.values.each_with_object({}) do |mock_constant, hash|
                   hash[mock_constant.send(:mocked_class)] = mock_constant
                 end)
end