Created
August 15, 2013 20:41
-
-
Save tomaslin/6244651 to your computer and use it in GitHub Desktop.
Iterate through all ratpack public specs and list contents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def output = new File('allTests.txt') | |
output.write('') | |
new File( System.getProperty("user.dir") ).eachDirRecurse{ | |
if( it.name == 'test' ){ | |
it.eachDirRecurse{ testDir -> | |
if( !testDir.absolutePath.contains( 'internal' ) && !testDir.absolutePath.contains('ratpack-test-support') ){ | |
testDir.eachFile{ file -> | |
if( file.name.endsWith('Spec.groovy') ){ | |
output << '*' * 80 | |
output << "\n" | |
output << file.absolutePath.replaceAll('/Users/tomaslin/', '' ) | |
output << "\n" | |
output << '*' * 80 | |
output << "\n" | |
file.eachLine{ line -> | |
if( !line.trim().empty && !line.startsWith( '/*' ) && !line.startsWith( ' *' ) && !line.startsWith( 'import') && !line.startsWith('package' )){ | |
output << line | |
output << "\n" | |
} | |
} | |
output << "\n" | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment