Skip to content

Evaluate shared/deduplicated fixture models across the spec suite #184

Open

Description

@eitoball

Summary

Follow-up to #169's "Shared fixture models (optional)" proposal, which hasn't been acted on yet.

Problem

#169's original proposal suggested moving stable, repeated model definitions into spec/support/models/ "only where duplication exceeds benefit," keeping Book/Isbn in spec/non_rails_app/ruby_classes.rb as the canonical non-Rails example. #180 and #182 addressed the other three proposed items (anonymous-class helper, CSV expectation helper, and — for #182 specifically — pulling ActiveRecord/Mongoid/DataMapper models out of describe blocks for RuboCop reasons), but neither PR looked at whether any plain (non-ORM) model classes are duplicated across spec files in a way worth consolidating.

Proposed approach

Audit spec/comma/comma_spec.rb, spec/comma/data_extractor_spec.rb, and spec/comma/header_extractor_spec.rb (all now using define_comma_class) for near-identical anonymous class bodies used across multiple examples. Only extract a shared support model where duplication genuinely exceeds the benefit of an inline, self-documenting example — per #169, this is explicitly optional and not about replacing the intentional inline-DSL style wholesale.

Acceptance criteria

  • Either: at least one duplicated model consolidated into spec/support/models/ with the duplicated inline definitions removed, or an explicit note (in this issue or a PR comment) that no consolidation was found to be worth it
  • No spec behavior changes

Depends on

#169, #180, #182

Out of scope

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions