Skip to content

Use eye.Spy for assertion failure checks and remove requireFailure helpers#8

Merged
nfisher merged 1 commit into
mainfrom
codex/inline-requirefailure-calls-and-remove-function
Jun 16, 2026
Merged

Use eye.Spy for assertion failure checks and remove requireFailure helpers#8
nfisher merged 1 commit into
mainfrom
codex/inline-requirefailure-calls-and-remove-function

Conversation

@nfisher

@nfisher nfisher commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Motivation

  • Standardize how test failures are inspected by replacing the ad-hoc requireFailure helper with the existing eye.Spy test spy for clearer intent and better integration with hammy assertions.
  • Eliminate duplicated helper code across multiple test files to reduce maintenance and accidental divergence.
  • Remove now-unused imports that were only needed for the helper and streamline test files.

Description

  • Added github.com/gogunit/gunit/eye imports to httpassert_test.go, jsonassert_test.go, and yamlassert_test.go and removed the requireFailure helper functions from those files.
  • Replaced calls like requireFailure(t, result, "...") with the spy pattern: aSpy := eye.Spy(); assert := hammy.New(aSpy); assert.Is(result); aSpy.HadErrorContaining(t, "...") to assert failure messages.
  • Removed now-unused imports (for example strings where applicable) and cleaned up the test files accordingly.

Testing

  • Ran go test ./... across the repository and the test suite completed successfully.
  • All modified tests that inspect assertion failure messages now use eye.Spy and passed when run under the test command.

Codex Task

@nfisher nfisher merged commit dd39a6f into main Jun 16, 2026
1 check passed
@nfisher nfisher deleted the codex/inline-requirefailure-calls-and-remove-function branch June 16, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant