README.md in active_mocker-1.2.4 vs README.md in active_mocker-1.3

- old
+ new

@@ -1,9 +1,9 @@ # ActiveMocker [![Build Status](https://travis-ci.org/zeisler/active_mocker.png?branch=master)](https://travis-ci.org/zeisler/active_mocker) -Creates mocks from Active Record models. Allows your test suite to run very fast by not loading Rails or hooking to a database. It parse the schema definition and the definded methods on a model then saves a ruby file that can be included with a test. Mocks are regenerated when the schema is modified so your mocks will not go stale. This prevents the case where your units tests pass but production code is failing. +Creates mocks from Active Record models. Allows your test suite to run very fast by not loading Rails or hooking to a database. It parse the schema definition and the defined methods on a model then saves a ruby file that can be included with a test. Mocks are regenerated when the schema is modified so your mocks will not go stale. This prevents the case where your units tests pass but production code is failing. Example from a real app Finished in 0.54599 seconds 190 examples, 0 failures @@ -164,31 +164,32 @@ => NoMethodError: undefined method `bar' for class `PersonMock' ### ActiveRecord supported methods **class methods** -* new - * create + * new + * create/create! * column_names * find - * find_by - * find_by! + * find_by/find_by! * find_or_create_by * find_or_initialize_by - * where - (only supports hash input) + * where(conditions_hash) * delete_all/destroy_all + * delete_all(conditions_hash) + * destroy(id)/delete(id) * all * count * first/last + **instance methods** -* attributes + * attributes * update - * save - * write_attribute - (private, can be used within an included module) - * read_attribute - (private) + * save/save! + * write_attribute/read_attribute - (private, can be used within an included module) **has_many associations** * empty? * length/size/count @@ -208,10 +209,9 @@ ### Known Limitations * Model names and table names must follow the default ActiveRecord naming pattern. * Included/extended module methods will not be included on the mock. I suggest you keep domain logic out of the model and only add database queries. Domain logic can be put into modules and then included into the mock during test setup. -* Deleting one record at a time is not support, this is a limitation of ActiveHash. * Queries will not call other mocks classes, for example when using `where` all attributes must reside inside of each record. ## Inspiration Thanks to Jeff Olfert for being my original inspiration for this project.