Last active
June 1, 2016 17:08
-
-
Save jakehawken/e428a0a41681e881f917f7504447c6b5 to your computer and use it in GitHub Desktop.
Ruby script for removing focused tests, describes, and contexts in the Cedar testing framework
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
desc 'remove focused tests' | |
task :nof do | |
testFiles = Dir.glob("YourProjectTests/**/*.mm") | |
testFiles.each do |file| | |
newRows = [] | |
File.open(file, 'r').each do |line| | |
newRows << line.gsub('fit(', 'it(').gsub('fdescribe(', 'describe(').gsub('fcontext(', 'context(') | |
end | |
contentOfArray = newRows.join | |
File.open(file, 'w').write contentOfArray | |
end | |
print("All tests, describes, and contexts have been unfocused.\n") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A little more Rubish: