0.0
No commit activity in last 3 years
No release in over 3 years
With the happy proliferation of TDD, test suites are getting massive, and developer efficiency is dwindling as we wait for our tests to pass. There is a big tradeoff between making unit test more integrationish (and therefore more reliable) vs. making them very mocky, unity and fast. Mockumentary is a library for the later. It inspects the ActiveRecord universe and makes a series of AR mockeries that approximate model without hitting the database, or making any assertions. The assertions, they are still part of the developers job. Mocumentary has two types of AR mockeries: One is used within the Rails universe. It uses introspection to derive association and field information. The second is a static copy built from the first. This static version can be used outside the Rails test universe in a suite faster than the speed of Rails environment load time. Mocking isn't for everyone, so test-drive responsibly.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.1.1
~> 1.0.0
~> 1.6.4
~> 2.3.0

Runtime

>= 0
>= 0
 Project Readme

mockumentary¶ ↑

With the happy proliferation of TDD, test suites are getting massive, and developer efficiency is dwindling as we wait for our tests to pass. There is a big tradeoff between making unit test more integration-ish (and therefore more life-like) vs. making them very mocky, unity and fast. Mockumentary is a library for the later. It inspects the ActiveRecord universe and makes a series of AR mockeries that approximate model without hitting the database, or making any assertions. The assertions, they are still part of the developers job in testing.

Mocumentary has two types of AR mock objects:

One is used within the Rails universe, a Mockery. It uses introspection to derive association and field information from its ActiveRecord class. It requires Rails or at least ActiveRecord in the test universe where it is used. These Mockeries can be dumped to YAML and used in an alternate universe of testing.…

The second, a Mocksimile, is a non-introspective version built from a Mockery. In fact, Mockery dumps its class descriptions to a YAML file that is loaded by Mocksimile. This static version can be used outside the Rails test universe in a suite faster than the speed of Rails environment load time.

Mocking isn’t for everyone, so test-drive responsibly.

Wiki pages available on github. Documentation in code will follow with if people start using it. Questions are always welcome through github too.

For terminology usage ‘mock’ vs ‘stub’ please see the Wiki. There is a note at the top of each page.

Contributing to mockumentary¶ ↑

  • Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet

  • Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it

  • Fork the project

  • Start a feature/bugfix branch

  • Write test(s) (in Rspec and in the appropriate place) that describe the bug or feature

  • Commit and push until you are happy with your contribution

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright © 2011 Kane Baccigalupi. See LICENSE.txt for further details.