Skip to content

Instantly share code, notes, and snippets.

@jstorimer
Created April 18, 2012 19:27
Show Gist options
  • Save jstorimer/2415933 to your computer and use it in GitHub Desktop.
Save jstorimer/2415933 to your computer and use it in GitHub Desktop.
# Put filenames on the pipe to have them loaded
# $ echo test/unit/foo_test.rb > zippy.pipe
require 'benchmark'
#
# load rails and the gems
result = Benchmark.realtime { require './config/application' }
puts "Loading gems took #{result}s"
# open pipe
pipe = open('zippy.pipe', 'r+')
loop do
filename = pipe.gets.strip
# create a process to run the tests
fork do
result = Benchmark.realtime { require File.expand_path(filename) }
puts "Running test took #{result}s"
end
Process.wait
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment