Created
May 27, 2014 16:39
-
-
Save mattantonelli/73a0e4a1edcf05bd3a69 to your computer and use it in GitHub Desktop.
assertEquals() Test Generator
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
input_path = "input.txt" | |
output = File.open("output.txt", "w") | |
File.readlines(input_path).each do |line| | |
if(line.include?("testGet")) | |
output.puts line | |
get_method = line[/Get.*\(\)/] | |
get_method[0] = get_method[0].downcase | |
test = "\t\tassertEquals(, record." << get_method << ");" | |
output.puts test | |
elsif(!line.include?("fail")) | |
output.puts line | |
end | |
end | |
output.close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment