ActiveMocker v2.0.0 Release Notes
Release Date: 2015-12-23 // over 8 years ago-
✨ Enhancement
- The mock append name is now changeable using
ActiveMocker::Config.mock_append_name=
. The default still beingMock
. - 🤡
ActiveMocker::MockRelation(mock, collection)
to create separate independent mock collections. - 🔄 Change
ActiveMocker::Mock::Base
toActiveMocker::Base
- 🏗 Provide more control over error when running
rake active_mocker:build
, error_verbosity now has setting for 0 to 3. - 🤡
db/schema.rb
is no longer required to generate mocks. - 👍 Much better support for Single Table Inheritance and gems that add functionality by being the parent class of model.
- 🆕 New DB types can be registered with this API.
ActiveRecordSchemaScrapper::Attribute.register_type(name: :array, klass: Array)
ActiveMocker::Config.disable_modules_and_constants=
Non locally defined Modules are included/extended by default as well as constant declarations. To Disable to feature set totrue
.- 🏗
MODEL=User rake active_mocker:build
no longer takes a model name to generate just that mock. It now takes a path to a model file.MODEL=[path-to-model] rake active_mocker:build
- 🏗 When running
rake active_mocker:build
failed will be listed.
🛠 Fix
- ⬇️ Reduce restriction on Virtus gem to 1.0.any
- When id is not a fixnum and make it match ActiveRecord behavior of calling
#to_i
.
🗄 Deprecated
- 🗄 Moved
ActiveMocker::MockAbilities
into "active_mocker/deprecated_components/mock_abilities" if a project is still dependent on it this file it can be required and used at least until version 3.0. The alternative is to useRSpec
verified doubles. - 🚚
#mock_class("Mock")
method has been moved to "active_mocker/deprecated_components/rspec_helper" if a project is still dependent on it this file it can be required and used at least until version 3.0. The alternative is to use the new api that is accessible by insteadactive_mocker.mocks.find('ClassName')
.
✂ Removed
- 🤡
log/active_mocker.log
is replaced envERROR_VERBOSITY=[0,1,2,3] rake active_mocker:build
or in RubyActiveMocker::Config.error_verbosity=
- 🚚 Removing undocumented feature of treating children of mocks differently. Remove the ability to sub class a mock and have it for use in that context when creating/finding association.
- The mock append name is now changeable using