Repository navigation
Description
Summary
Discovered while implementing #182: spec/comma/rails/mongoid_spec.rb and spec/comma/rails/data_mapper_collection_spec.rb never actually run, in any CI configuration this repo has today.
Problem
Both spec files are guarded by if defined? Mongoid / if defined? DataMapper. No Gemfile, gemfiles/*.gemfile, or Appraisals entry in this repo installs the mongoid or data_mapper gem — Appraisals only defines rails*/active* (ActiveRecord) appraisals. spec/spec_helper.rb's ORM loader (%w[data_mapper mongoid active_record].each { ... require ... break }) will therefore never require either gem successfully, so both spec files' describe bodies are dead code, and so are the corresponding new spec/support/models/mongoid_models.rb / data_mapper_models.rb files added in #182 (each wrapped in the same always-false if defined?(...) guard).
Separately: lib/comma/mongoid.rb and lib/comma/data_mapper_collection.rb are shipped library code (not just specs) implementing support for these two ORMs, which is consequently untested by CI despite being part of the public gem surface.
This isn't a regression from #182 — the condition predates it — but it means the "spec suite" for two of the library's supported integrations provides no actual regression protection today.
Proposed approach (needs a decision, not just an implementation)
One of:
- Add real Appraisal/gemfile entries for
mongoidanddata_mapperso these specs and the correspondinglib/code actually run in CI again. - Drop Mongoid/DataMapper support (specs +
lib/comma/mongoid.rb+lib/comma/data_mapper_collection.rb+ gemspec references, if any) if these integrations are no longer meant to be supported, with a note in the changelog. - Leave as documentation-only, but make the dead-code status explicit (e.g. a comment at the top of each spec file and support model, or a README/CONTRIBUTING note) so it doesn't look like accidental oversight to future contributors.
This needs a decision on intent (still-supported ORM vs. legacy vs. abandoned) before any code changes — that's a decision for the maintainer, not something to infer from the code.
Acceptance criteria
- A decision recorded on which of the above (or another option) to pursue
- If option 1: CI runs mongoid/data_mapper specs and they pass
- If option 2: dead code and its references (gemspec, lib, spec, spec/support/models) are removed together, not partially
- If option 3: dead-code status is documented in the affected files
Depends on
#182 (where this was discovered)
Out of scope
- Changing the Appraisal matrix for actively-supported ORMs (ActiveRecord/Rails) — out of scope per Incremental spec suite hygiene #169 too
🤖 Generated with Claude Code
Activity