### Comment Unit Tests

### Author

Blaine Buxton ([email protected])

### Copyright

Copyright © 2008

### License

See LICENSE

### ### This is a simple framework that hooks into Test::Unit and RDoc. ### It allows you to write arbitrary bits of code in comments that can be ### executed and then verified via Test::Unit. It uses the RDoc parser to obtain ### the comments. ### ### Any comments are appreciated (pun not intended) ### ### To invoke: ### require ‘comment_unit’ ### class YourTest < Test::Unit::TestCase ### def self.suite ### suite=super ### suite << RUnitComment.on($0) ### suite ### end ### end ### ### Examples: ### >>> 3 + 4 ### >>= 7 ### ### >>> 42 ### >>= 42 ### ### >>> a=‘i’ ### >>> b=‘ love ’ ### >>> c=‘michelle’ ### >>> a + b + c ### >>= ‘i love michelle’ ### ### >>> a + ‘, robot will never die’ ### >>= ‘i, robot will never die’ ### ### >>> a = 5 ### >>> b = 4 + 1 ### >>? a == b ### ### >>> puts ‘Comments Ran’