Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Documentation as tests in Ruby?

There is a great tool rustdoc (currently used by cargo) to test examples of documentation comments in Rust. Does rdoc or yard give us something similar in Ruby?

like image 711
Vitalii Elenhaupt Avatar asked May 29 '26 03:05

Vitalii Elenhaupt


1 Answers

Well, there few examples of doctest tool in Ruby, and the most fresh one (for now) is yard-doctest:

Meet YARD::Doctest - simple and magical gem, which automatically parses your @example tags and turn them into tests!

Probably no so powerful as rustdoc, but it does what it needs to.

like image 184
Vitalii Elenhaupt Avatar answered Jun 01 '26 20:06

Vitalii Elenhaupt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!