Created
January 23, 2015 18:01
-
-
Save davetapley/c5a9ba3c0222ada8de01 to your computer and use it in GitHub Desktop.
Pending failing rspec tests
This file contains hidden or 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
#!/usr/bin/ruby | |
require 'pty' | |
cmd = ARGV.first | |
begin | |
PTY.spawn( cmd ) do |stdin, stdout, pid| | |
begin | |
stdin.each do |line| | |
line_no_color = line.gsub(/\e\[(\d+)(;\d+)*m/, '') | |
match = /.*rspec ([^ ]*):([^ ]*) .*/.match(line_no_color) | |
next unless match | |
file_name, line_num = match.captures | |
`sed -i '#{ line_num }s/it /pending /' #{ file_name }` | |
end | |
rescue Errno::EIO | |
puts 'done' | |
end | |
end | |
rescue PTY::ChildExited | |
puts "The child process exited!" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment