Skip to content

test: expand coverage and clean up misleading Content-Type#14

Closed
Koan-Bot wants to merge 1 commit into
masterfrom
koan.atoomic/expand-tests-and-cleanup
Closed

test: expand coverage and clean up misleading Content-Type#14
Koan-Bot wants to merge 1 commit into
masterfrom
koan.atoomic/expand-tests-and-cleanup

Conversation

@Koan-Bot

@Koan-Bot Koan-Bot commented Mar 23, 2026

Copy link
Copy Markdown
Collaborator

What

Expand test coverage from 46 to 64 tests and remove dead code.

Why

Several public APIs had zero test coverage (post_info, notify_slack direct call, content/body aliases, auto_detect_utf8 => 0 mode). The Content-Type: application/json default header in _build__http was misleading — post_form() always sends application/x-www-form-urlencoded, so the header was never used.

How

  • Added tests for all untested code paths and error conditions
  • Removed the dead default_headers from HTTP::Tiny constructor
  • Fixed POD typo ("layour" → "layout")

Testing

prove -Ilib -v t/hooks.t — 64/64 pass locally.

🤖 Generated with Claude Code


Quality Report

Changes: 2 files changed, 168 insertions(+), 9 deletions(-)

Code scan: clean

Tests: passed (OK)

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

Add test coverage for previously untested paths:
- post_info (both text and key-value forms)
- post() with too many arguments
- notify_slack() direct call with single string
- notify_slack() content and body aliases for text
- notify_slack() error paths (zero args, odd args)
- auto_detect_utf8 => 0 disabled mode

Also:
- Remove misleading Content-Type header from _build__http: post_form()
  always sends application/x-www-form-urlencoded, so the JSON header
  was dead code that confused readers.
- Fix POD typo: "layour" → "layout"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Koan-Bot

Copy link
Copy Markdown
Collaborator Author

Closing — superseded by #20, which makes the Content-Type header useful (JSON post) rather than just removing it. The test coverage additions here are also covered by #20's expanded tests and #22's edge-case suite.

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