Skip to content

Bring the notations back into Assay as one library - #3

Merged
trans merged 1 commit into
masterfrom
single-library
Nov 23, 2026
Merged

trans merged 1 commit into
masterfrom
single-library

Conversation

@trans

@trans trans commented Nov 23, 2026

Copy link
Copy Markdown
Member

Assay becomes a single library of assertion notations over one set of assertion classes. The four gems spun off in 0.4 come back, each loaded on its own:

Require Notation Was
assay/fluidity x.should.equal y, x.assert == y gem fluidity
assay/rspec should eq, expect(x).to eq gem rspecial
assay/minitest assert_equal, must_equal gem assay-minitest
assay/testunit assert_equal gem assay-testunit

Fluidity is now Assay::Fluidity and RSpecial is Assay::RSpec. Their demos came along, under demo/<notation>/. The version is 0.5.0 in lib/assay/version.rb; HISTORY is under Unreleased.

Also in here

  • The Minitest and Test::Unit adapters are rewritten for Minitest 5 and 6 and test-unit 3. The old ones patched MiniTest::Unit#puke and a TestCase#run that no longer exist.
  • expect takes a block, so expect{ ... }.to raise_error(ArgumentError) works.
  • Packaging: assay.gemspec, Rakefile and GitHub Actions (Ruby 2.7 to 4.0) replace .index, Assembly, MANIFEST and Travis. work/, try/ and var/ are removed.

Bugs fixed

  • With fluidity/assert loaded, assert(false) returned a grammar object and passed. Assay itself called that assert, so no assay could fail either. Assay now calls BRASS's Kernel.assert directly.
  • The fluent fallback to an object's own query method ignored negation.
  • will_not and wont were never defined; loading the will notation raised NameError.
  • assert_in_epsilon and assert_not_in_epsilon raised NameError in the Test::Unit notation.
  • LessAssay, LessEqualAssay, MoreAssay and MoreEqualAssay reported 5 <=> 3 == 0 in place of 5 <= 3.
  • CloseAssay was wrong for a negative criterion.
  • Kernel#like? called =~, which Ruby 3.2 removed from Object. It now matches Facets' like?.

Testing

rake runs three things, all passing on Ruby 3.4.9:

  • the QED demos, one process per notation (each extends Object differently): 53 demos, 329 steps;
  • the Lemon unit tests under Rubytest: 138 tests (master has 96 errors here);
  • a check that a failed assay counts as a failure, not an error, under Minitest and under Test::Unit with the adapters loaded.

Not in here

  • be and bang. They are built on BRASS, not on Assay's classes, so adding them means porting them.
  • A release. The four old gems are untouched.

🤖 Generated with Claude Code

Fluidity, RSpecial, Assay MiniTest and Assay TestUnit were spun off as
separate gems in 0.4. They return as assay/fluidity, assay/rspec,
assay/minitest and assay/testunit, each loaded on its own, with their
demos. The Minitest and Test::Unit adapters are rewritten for current
versions of those frameworks.

Fixes found on the way: with the fluent assert loaded no assay could
fail; negation was ignored in the fluent fallback; will_not was never
defined; assert_in_epsilon raised NameError in the Test::Unit notation;
the ordering assays had the wrong message; like? used the =~ that
Ruby 3.2 removed from Object.

Replaces the old packaging with a gemspec, Rakefile and GitHub Actions.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@trans
trans merged commit 5a45e93 into master Nov 23, 2026
14 checks passed
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