Socket
Book a DemoInstallSign in
Socket

mockumentary

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mockumentary

0.2.1
bundlerRubygems
Version published
Maintainers
1
Created
Source

= 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

Copyright (c) 2011 Kane Baccigalupi. See LICENSE.txt for further details.

FAQs

Package last updated on 29 Nov 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.