ActiveMocker v2.0.0 Release Notes

Release Date: 2015-12-23 // over 6 years ago
  • โœจ Enhancement

    • The mock append name is now changeable using ActiveMocker::Config.mock_append_name=. The default still being Mock.
    • ๐Ÿคก ActiveMocker::MockRelation(mock, collection) to create separate independent mock collections.
    • ๐Ÿ”„ Change ActiveMocker::Mock::Base to ActiveMocker::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 to true.
    • ๐Ÿ— 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 use RSpec 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 instead active_mocker.mocks.find('ClassName').

    โœ‚ Removed

    • ๐Ÿคก log/active_mocker.log is replaced env ERROR_VERBOSITY=[0,1,2,3] rake active_mocker:build or in Ruby ActiveMocker::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.