No commit activity in last 3 years
No release in over 3 years
a simple library for analyzing the dependencies between your factory_girl factories
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
~> 10.0

Runtime

 Project Readme

FactoryGirl::DependencyTree

a simple library for analyzing the dependencies between your factory_girl factories

Description

This gem prints out all of the other factories that your factories call. It helps to reveal chains of factory calls that might be broken, unnecessary, or inefficient. For example, we had factory chains that would create users at multiple points causing inconsistencies (which we hacked around using callbacks to resync them). Since we've fixed these we've seen some of our factories perform an order of magnitude better resulting in some tests running 50% faster.

Installation

gem 'factory_girl-dependency_tree'

Usage

The ::analyze! method is an example for how this can be used. Here is a script you should be able to run with Rails depending on how complex your test environment is. It will output the dependency tree and warn you if there are any factories that are being called more than once.

rails runner "require 'factory_girl-depedency_tree'; FactoryGirl::DependencyTree.analyze!"