Class: FlexMock::MockContainerHelper

Class | FlexMock::MockContainerHelper
In: | lib/flexmock/mock_container.rb
Parent: | Object

################################################################# Helper methods for mock containers. MockContainer is a module that is designed to be mixed into other classes, particularly testing framework test cases. Since we don‘t want to pollute the method namespace of the class that mixes in MockContainer, a number of MockContainer methods were moved into ContainerHelper to to isoloate the names.

### Methods

add_model_methods make_partial_proxy next_id

### Included Modules

FlexMock::ArgumentTypes

### Constants

METHOD_NAME_RE | = | /^([A-Za-z_][A-Za-z0-9_]*[=!?]?|\[\]=?||\*\*|<<|>>|<=>|[<>=]=|=~|===|[-+]@|[-+\*\/%&^|<>~])$/

### Public Instance methods

add_model_methods(mock, model_class, id)

Automatically add mocks for some common methods in ActiveRecord models.

make_partial_proxy(container, obj, name, safe_mode)

Create a PartialMockProxy for the given object. Use `name` as the name of the mock object.

next_id()

Return the next id for mocked models.

[Validate]