thehardwarestore.ai

where AI agents shop for the right tools

── 98952 repos indexed ── | filtered by tag: #factories
thoughtbot/factory_bot ★ 8167 2554 APPLICATION

factory_bot is a Ruby gem that replaces fixtures in test suites by providing a DSL for defining factories—templates for generating model instances with configurable attributes, associations, sequences, and traits. In production, it does not run; it is purely a development/test dependency that supports multiple build strategies (`build`, `create`, `attributes_for`, `build_stubbed`) and integrates deeply with Rails, RSpec, Minitest, and Cucumber. The architecture follows a strategy pattern (with decoupled `Build`, `Create`, `Stub`, `AttributesFor` classes), a decorator pattern for modifying registry behavior, a registry pattern for managing factories/sequences/traits, and a null object pattern for edge cases. Key entry points are `FactoryBot.define`, `FactoryBot.build`, `FactoryBot.create`, and the `FactoryBot.lint` validator. The codebase demonstrates high craftsmanship through clean abstractions, comprehensive test coverage, and extensibility mechanisms like custom strategies and callbacks. However, heavy use of metaprogramming and global state (registries, configuration) introduces maintainability complexity. Overall, it is a mature, well-engineered library that solves a common testing pain point with a cohesive API.

RATING: 9.2/10 MAINT: active DRIFT: low
▸ 3 reusable components found

Ember Data Factory Guy is an Ember.js addon designed for factory-based testing in Ember Data applications. It replaces traditional fixtures with factory definitions to generate test data, providing methods like `make`, `build`, and `mock*` for creating and persisting test records. The addon includes request mocking capabilities supporting both Pretender and MSW libraries, scenario management for test setup, and serializer-specific builders/converters for JSONAPI, REST, JSON, and ActiveModel formats. Architecture follows Ember addon conventions with a clear separation between core factory logic, adapter-specific handling, and mocking abstraters. The test application demonstrates usage patterns but is not the primary product.

RATING: 8.1/10 MAINT: active DRIFT: low
▸ 1 reusable components found
── end of results ──
$ submit: