# $Id$ # $URL$ # From: # http://www.reevoo.com/blogs/bengriffiths/2005/06/24/a-test-by-any-other-name/ desc "Print the responsibilities of each class" task :agiledox do tests = FileList['test/**/*_test.rb'] tests.each do |file| m = file.match(%r".*/([^/].*)_test.rb") puts m[1]+" should:\n" test_definitions = File::readlines(file).select {|line| line =~ /^[^#]*def test.*/} test_definitions.each do |definition| m = definition.match(/test_(should_)?(.*)/) puts " - " + m[2].gsub(/_/," ") end puts "\n" end end