Skip to content

Support block defaults for cattr and mattr#316

Open
dicnunz wants to merge 1 commit intorubyworks:mainfrom
dicnunz:issue-258-cattr-block-defaults
Open

Support block defaults for cattr and mattr#316
dicnunz wants to merge 1 commit intorubyworks:mainfrom
dicnunz:issue-258-cattr-block-defaults

Conversation

@dicnunz
Copy link
Copy Markdown

@dicnunz dicnunz commented May 9, 2026

Summary

  • Adds block defaults to cattr/cattr_reader/cattr_writer/cattr_accessor
  • Mirrors the same block-default behavior for mattr helpers
  • Adds focused module tests for reader/accessor defaults and write-after-default behavior

IssueHunt bounty:

Testing

  • bundle install --path vendor/bundle --without guard
  • bundle exec ruby-test -Ilib/core test/core/module/test_mattr.rb
  • bundle exec ruby-test -Ilib/core test/core/module
  • ruby -c lib/core/facets/module/mattr.rb
  • direct Ruby smoke for cattr_accessor and mattr_accessor block defaults
  • git diff --check

Note: a plain bundle install --path vendor/bundle tries to install the optional guard group and fails on this machine because ffi-1.17.4-x86_64-darwin requires Ruby >= 3.0, while the system Ruby here is 2.6.10. Installing without the guard group was enough for the test suite commands above.

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