Repository navigation
Conversation
assay/bang is the Bang gem rebuilt on Assay's classes, after the sketch in that project's work/ideas/assay-based: x.equal!(y) fails with an EqualAssay, and a query method Assay has no class for (10.even!) fails with an Assertion. Methods are resolved when called, by method_missing, so nothing is defined ahead of time. A trailing Hash was always popped as options, so comparing two hashes raised ArgumentError in every notation. Now only a Hash whose keys are all :message or :backtrace is options, and the notations always pass options explicitly. Co-Authored-By: Claude Fable 5.2 <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.
Adds
assay/bang, the Bang gem rebuilt on Assay's classes, following the sketch already in that project (work/ideas/assay-based).method_missing: first an assay class by name or operator, then the object's ownfoo?. Nothing is defined ahead of time, so assay classes added later are found and real bang methods (String#upcase!) are untouched.respond_to?agrees with it.Bang::Assertion; the query methods it added to Object (equal_to?,raises?and so on) are not carried over.Bug fixed
A trailing Hash was always popped as options, so comparing two hashes raised ArgumentError in every notation:
Only a Hash whose keys are all
:messageor:backtraceis options now, and the notations pass options explicitly.Testing
rakeon Ruby 3.4.9: 54 demos (355 steps) including the newdemo/bang, 138 unit tests, adapter check, all passing.🤖 Generated with Claude Code