Created
April 19, 2017 13:08
-
-
Save joenas/b6da111c8841ede0c3831a688c7eb5c5 to your computer and use it in GitHub Desktop.
OS X notifications with parallel_spec
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
#!/usr/bin/env ruby | |
require 'terminal-notifier-guard' | |
path = ARGV[0] || 'spec' | |
output = `parallel_rspec #{path} -n 8 --nice` | |
num = output.scan(/(\d) failure/).flatten.map(&:to_i).inject(0, &:+) | |
meth = (num>0) ? :failed : :success | |
TerminalNotifier::Guard.send(meth, "#{num} failures", title: 'RSpec results') | |
$?.success? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment