Repository navigation
Add the AE notation, and fix fluent assertions that never failed - #5
Merged
Merged
Conversation
The fluent grammar classes inherited from Object, so kind_of?, nil?, eql?, respond_to?, != and the like were answered by the grammar object and asserted nothing. They are built on BasicObject now, as is the RSpec notation's operator delegate. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
assay/ae is the AE gem's notation (x.assert == y, expect, and optionally should, must and ok/no) built on Assay's classes. The object's own method decides the result; where an Assay class covers the method, the failure is of that class. 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.
Two commits.
Fix fluent assertions on methods every object has
In
assay/fluidity, an assertion using a method that Object already has asserted nothing:The grammar classes inherited from Object, so the grammar object answered
kind_of?,instance_of?,nil?,eql?,equal?,respond_to?,is_a?,frozen?and!=itself. The Fluidity gem always had this flaw; the demos only asserted true cases.!=is anUnequalAssay.expect(10).to.kind_of?(String)returned false). It is a NoMethodError now, since that notation has matchers for named methods.demo/fluidity/05_object_methods.mdasserts the failing cases.Add the AE notation
require 'assay/ae'gives the AE gem's notation on Assay's classes:Assay::AE::Assertoris AE's Assertor. The object's own method decides the result, as in AE; the Assay class registered for that operator, if any, is the class of the failure. AE's own words map too (eq?,case?,equal?,in_delta?,in_epsilon?,raised?,thrown?).x.assert.like?(y),x.assert.kind_of(K)), the Assay class makes the test.assertaccepts an Assay matcher:10.assert EqualAssay[10].assay/ae/should,assay/ae/must,assay/ae/check.$ASSERTION_COUNTS, as with every notation.ae/legacy(there isassay/testunit),ae/pry, and AE's adapters (Assay has its own).The AE gem is untouched and stays independent.
assay/aeandassay/fluidityboth defineassert,shouldandmuston Object, so it is one or the other; the README says so.Testing
AE's own demos, adapted, are
demo/ae(plus09_assay.mdfor the typed failures): 8 demos, 165 steps.rakeon Ruby 3.4.9: all seven demo sets, 138 unit tests and the adapter check pass.🤖 Generated with Claude Code