Skip to content

Instantly share code, notes, and snippets.

@tomaslin
Created August 15, 2013 20:41
Show Gist options
  • Save tomaslin/6244651 to your computer and use it in GitHub Desktop.
Save tomaslin/6244651 to your computer and use it in GitHub Desktop.
Iterate through all ratpack public specs and list contents
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