freerange / mocha

A mocking and stubbing library for Ruby
https://mocha.jamesmead.org
Other
1.21k stars 157 forks source link

Investigate whether YARD example definitions can be nested under overload definitions #424

Open floehopper opened 4 years ago

floehopper commented 4 years ago

e.g. in docs for Mock#expects

If YARD supports this properly, I think it could make the documentation a lot clearer.

floehopper commented 1 year ago

I've just tried this with yard v0.9.28 and it seems to work as I expected.

floehopper commented 1 year ago

I've experimented with this in https://github.com/freerange/mocha/compare/yardoc-nest-examples-within-overloads. It looks promising.

floehopper commented 1 year ago

I think we might be able to use this for Expectation#with if we separate the block version of the method into a separate overload and the nest the examples accordingly.