Repository navigation
test: enforce 95% coverage with SimpleCov and close all spec gaps - #55
Merged
Merged
Conversation
Create#authenticate_service was never called and referenced params / resource_class, which don't exist on this service (KI-5). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds SimpleCov (95% line minimum on full-suite and CI runs; suite now at 100% line/branch), real monad-contract service specs (KI-12), generator specs (KI-13), token model and helpers specs, config-override request specs (KI-14), and a bare AdminUser dummy model so the optional-module false branches are exercised end-to-end. Docs updated to match. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bundle exec rake) and CI; the suite now sits at 100% line and 100% branch coverage (282 examples).TokensService::Create#authenticate_servicemethod (KI-5) in a separate commit.Changes
simplecov ~> 0.22in the Gemfile (compatible with the Ruby 2.7 CI floor);SimpleCov.startat the top ofspec/spec_helper.rbbefore the gem loads; minimum enforced only whenCIorENFORCE_COVERAGEis set — a newenforce_coverageRakefile prerequisite sets it forrake, so single-filerspecruns stay unaffected.version.rbis filtered (loaded by the gemspec before coverage can start).spec/services/**): replaced the six inheritance-only placeholders withSuccess/Failurecontract specs, including branches unreachable via HTTP (:invalid_resource_owner,:devise_api_token_create_error,:devise_api_token_revoke_error, sign-up transaction rollback).install_generator_spec.rb(migration template, locale copy, migration numbering),token_spec.rb(active?/inactive?,expires_in_infinite, generator collision retry, conditional validations),helpers_spec.rb(invalid-locationArgumentError, header-extraction rescue, unmemoized refresh-token lookup),configuration_overrides_spec.rb(disabled sign_up/refresh,extra_fields, revoke failure,:header/:params-only locations, witharound/ensureconfig restore),admin_user_tokens_spec.rb,customized_path_names_routes_spec.rb.AdminUsermodel (database_authenticatable, registerable, validatable, :apionly) with table, migration, factory anddevise_for :admin_usersroutes, so every "optional Devise module not enabled" branch is exercised end-to-end;users.namecolumn added forextra_fieldscoverage.ErrorResponsevariants (incl.unlock_at),TokenResponserefresh-disabled/extra-fields/non-confirmable bodies,Configurationoverrides on fresh instances.TokensService::Create; one pre-existing over-length line intoken_response.rbreformatted for RuboCop (no behavior change).testing.mdcoverage section + fully-green coverage map,known-issues.md(KI-5/12/13 resolved, KI-14 mostly resolved),development.md,services.md.Architecture Impact
admin_userstable,users.name) affect the test schema only — the gem's generator template is untouched.Gemfile.lock: simplecov + deps,arm64-darwin-25platform entry, and recording the gem's own 0.1.3 → 0.2.0 drift.Test Plan
bundle exec rakegreen (282 examples, 0 failures; RuboCop 0 offenses)CI=truefails with the below-minimum error--order random— no config leakage between examplesRelated
docs/analysis/known-issues.md🤖 Generated with Claude Code