Skip to content

remove dead code and add API guard tests#83

Draft
toddr-bot wants to merge 1 commit into
mainfrom
koan.toddr.bot/test-api-guards-and-cleanup
Draft

remove dead code and add API guard tests#83
toddr-bot wants to merge 1 commit into
mainfrom
koan.toddr.bot/test-api-guards-and-cleanup

Conversation

@toddr-bot

@toddr-bot toddr-bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

What

Removes an unused package variable and adds test coverage for previously untested
public API guard conditions.

Why

$_POST_METHOD was declared as our in Net::ACME2 but never read or assigned —
pure dead code. The four guard conditions tested here (constructor validation,
http_timeout() sync/async behavior, update_account() key_id check) are
documented public API behaviors that had zero test coverage.

How

  • Deleted our $_POST_METHOD; (line 1147) — confirmed via grep that no code
    references it anywhere.
  • New t/Net-ACME2-api-guards.t covers:
    • new() without key → dies
    • http_timeout() passthrough in sync mode (get, set, verify)
    • http_timeout() rejection in async mode (mock async UA)
    • update_account() without key_id → dies

Testing

Full test suite passes (all existing tests + 4 new subtests with 6 assertions).


Quality Report

Changes: 3 files changed, 116 insertions(+), 2 deletions(-)

Code scan: clean

Tests: passed (OK)

Branch hygiene: clean

Generated by Kōan

Remove unused $Net::ACME2::_POST_METHOD package variable (declared
but never read or assigned anywhere in the codebase).

Add t/Net-ACME2-api-guards.t covering previously untested guard
conditions in the public API:
- new() without key throws
- http_timeout() sync mode passthrough
- http_timeout() async mode rejection
- update_account() without key_id throws
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant