Skip to content

Instantly share code, notes, and snippets.

@igaiga
Created March 13, 2016 09:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igaiga/0caa82300975865ee94b to your computer and use it in GitHub Desktop.
Save igaiga/0caa82300975865ee94b to your computer and use it in GitHub Desktop.
methods = []
File.open("path_to_ruby_test/test_string.rb", "r") do |f|
f.each_line do |line|
methods << $1 if line =~ /\A\s*def\s+(.+)\s+/
end
end
target_test_methods = methods.map{ |x| x =~ /^test_(.+)\z/ ? $1 : nil }.compact.sort
p target_test_methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment