Adopt underused buttercup facilities in the test suite#4075
Merged
Conversation
An audit against the buttercup docs found features we weren't using: - assume: environment-dependent specs (libxml, cygwin paths) now report as skipped instead of silently asserting a fallback branch. - Custom matchers in cider-test-utils: :to-have-sent-op collapses the spy-and-pluck plumbing around nREPL request assertions and names the offending key on failure; :to-equal-dict compares nrepl-dicts order-insensitively and reports differing keys. - spy-calls-most-recent instead of indexed spy-calls-args-for, which breaks when a function gains an earlier call. The hacking guide documents the conventions.
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.
An audit of the buttercup docs against our usage found a few features worth adopting:
assume: environment-dependent specs (libxml rendering, cygwin path translation) now report as skipped with a reason instead of silently asserting a fallback branch. Sample output:CANCELLED !! libxml support is available.test/utils/cider-test-utils.el)::to-have-sent-opcollapses the spy-and-pluck plumbing around nREPL request assertions (cider-log-tests' request block shrank by ~40 lines) and names the mismatching key on failure instead of dumping request plists;:to-equal-dictcompares nrepl-dicts order-insensitively with key-level failure messages.spy-calls-most-recentover indexedspy-calls-args-for, which breaks when a function gains an earlier internal call.The hacking guide gains a short conventions section so future tests (and test-writing agents) follow the same patterns. Not adopted, deliberately: ERT-compat
should(we're uniformly buttercup), bodyless-itpending specs,:to-be-close-to(no float-sensitive assertions).