Registry / testing / factory-girl

factory-girl

JSON →
library4.9.0rbrubygemsunverified

factory_girl provides a framework and DSL for defining and using factories, offering a less error-prone and more explicit alternative to fixtures.

gem install factory_girl
INSTALL
IMPORT
SIG · FACTORY-GIRL
F
factory-girl
testingrubyv4.9.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FactoryGirl
require 'factory_girl'

Define a factory for a User model and create an instance.

require 'factory_girl' FactoryGirl.define do factory :user do name { 'John Doe' } email { 'john@example.com' } end end user = FactoryGirl.create(:user) puts user.name
Debug
Known issues
breakingFactoryGirl was renamed to FactoryBot in version 5.0; the old gem name is deprecated.
fix
Use the 'factory_bot' gem and require 'factory_bot' instead.
affects: < 5.0
Upgrade
Version history
4.9.0latest on RubyGems
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
factory-girl — gem install factory-girl · libregistry