Skip to content

Configuration and Adapters

Ngan Pham edited this page Feb 24, 2026 · 1 revision

Configuration and Adapters

Use configuration to set fixture locations, cache locations, adapter behavior, and callback hooks.

Basic Configuration

FixtureKit.configure do |config|
  config.fixture_path = Rails.root.join("spec/fixture_kit").to_s
  config.cache_path = Rails.root.join("tmp/cache/fixture_kit").to_s

  config.adapter(FixtureKit::RSpecAdapter)
end

Adapter Concept

Adapters isolate fixture generation inside framework-specific execution flow.

  • FixtureKit::RSpecAdapter executes generation in an internal RSpec example.
  • FixtureKit::MinitestAdapter executes generation in an internal ActiveSupport::TestCase test.

Custom adapters should subclass FixtureKit::Adapter.

Canonical Signatures and Defaults

For exact method signatures, defaults, callback contracts, and errors, use the canonical in-repo reference:

Clone this wiki locally