Skip to content

Releases: Gusto/fixture_kit

v0.12.0

05 Mar 06:54
48c682e

Choose a tag to compare

What's Changed

  • Use unscoped when finding exposed records by @ngan in #35

Full Changelog: v0.11.2...v0.12.0

v0.11.2

04 Mar 20:33
4af4ade

Choose a tag to compare

What's Changed

  • Fix STI resolution for models inheriting directly from ActiveRecord::Base by @robbiegill in #34

Full Changelog: v0.11.1...v0.11.2

v0.11.1

01 Mar 12:56
272be2c

Choose a tag to compare

What's Changed

  • Fix fixture declarations not propagating to auto-included shared example groups by @ngan in #33

Full Changelog: v0.11.0...v0.11.1

v0.11.0

26 Feb 19:31
527b476

Choose a tag to compare

What's Changed

  • Add factory let analyzer for finding optimization targets by @mzruya in #25
  • Clear MemoryCache for inline fixtures after context finishes by @ngan in #31

New Contributors

Full Changelog: v0.10.0...v0.11.0

v0.10.0

26 Feb 05:48
fabfee5

Choose a tag to compare

Fixture Inheritance

Fixtures can now extend other fixtures via extends:, enabling parent-child relationships that share setup data without duplication.

Named fixture inheritance

Define a base fixture, then extend it in a child file:

# spec/fixture_kit/company/base.rb
FixtureKit.define do
  company = Company.create!(name: "Acme Corp")
  owner = User.create!(name: "Alice", company: company, role: "owner")
  expose(company: company, owner: owner)
end

# spec/fixture_kit/company/with_employees.rb
FixtureKit.define(extends: "company/base") do
  employee = User.create!(name: "Bob", company: parent.company, role: "employee")
  expose(employee: employee)
end

Inline fixture inheritance

Extend a named fixture directly in a test:

RSpec.describe "onboarding" do
  fixture(extends: "company/base") do
    onboarding = Onboarding.create!(company: parent.company, admin: parent.owner)
    expose(onboarding: onboarding)
  end

  it "sets up onboarding for the company" do
    expect(fixture.onboarding.company.name).to eq("Acme Corp")
  end
end

Multi-level chains

Inheritance chains work to any depth — grandchild → child → base. Parent fixtures are generated before their children automatically.

Exposure rules

Only the child's explicitly exposed records are accessible via fixture.*. Parent records are present in the database and reachable through associations, but not auto-exposed.

Circular dependency detection

Circular chains (A extends B, B extends A) are detected at registration time and raise FixtureKit::CircularFixtureInheritance.

Breaking Changes

  • Fixture#cache renamed to Fixture#generate
  • Registry#add argument order changed to (name_or_definition, scope)
  • Runner#register argument order changed to (name_or_definition, scope)
  • Cache data format changed: model classes as keys instead of string names
  • Repository record format changed from { "model" => name, "id" => id } to { ModelClass => id }

v0.9.1

24 Feb 22:53
ba02e2e

Choose a tag to compare

What's Changed

  • Always include FixtureKit::RSpec instance methods by @ngan in #29

Full Changelog: v0.9.0...v0.9.1

v0.9.0

24 Feb 07:08
2d28e93

Choose a tag to compare

What's Changed

  • Evaluate fixture definitions in adapter execution context by @ngan in #28

Full Changelog: v0.8.0...v0.9.0

v0.8.0

24 Feb 05:54
c76b9f9

Choose a tag to compare

What's Changed

  • Make repository exposed records lazy and document lookup gotchas by @ngan in #24
  • Refactor cache callbacks into event registry by @ngan in #26
  • docs: migrate guides to wiki and slim README by @ngan in #27

Full Changelog: v0.7.0...v0.8.0

v0.7.0

24 Feb 00:56
ebb0b16

Choose a tag to compare

Highlights

  • Added STI-aware SQL write tracking so fixture caching resolves subclass write events to the base table-owning model.
  • Added dummy app STI integration coverage for both RSpec and Minitest.
  • Improved cache replay behavior by batching restore statements per connection in Cache#load.
  • Moved cache generation into framework lifecycle hooks while keeping runner startup focused on cache clearing/start state.

Tooling and Test Coverage

  • Extended unit coverage across runner lifecycle, SQL subscriber event handling, and cache replay behavior.
  • Expanded integration coverage in dummy app suites for STI and queue-style execution behavior.

Full Changelog

v0.6.0...v0.7.0

v0.6.0

23 Feb 21:04
f0b17fd

Choose a tag to compare

Highlights

  • Moved fixture cache generation into framework lifecycle hooks:
    • RSpec generates per declaring group in before(:context).
    • Minitest generates per declaring class in class-level run_suite.
  • Simplified runner startup semantics:
    • Runner#start now handles startup/clear-cache only.
    • Cache generation is now framework-driven.
  • Improved cache loading performance by batching restore statements per DB connection and issuing one execute_batch per connection.

Additional updates

  • README lifecycle documentation updated to match current behavior.
  • Expanded unit coverage for runner lifecycle, RSpec/Minitest entrypoint behavior, and cache batching.

Full Changelog

v0.5.0...v0.6.0