Last active
August 29, 2015 14:06
-
-
Save wtnabe/2a464020c54c0ff28350 to your computer and use it in GitHub Desktop.
rake dependencies for starting server outside ruby ( e.g. PythonSimpleHTTPServer ) and cleanup
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
require "rake/testtask" | |
Rake::TestTask.new do |t| | |
t.description = nil | |
t.pattern = 'spec/**/*_spec.rb' | |
end | |
desc 'start server and do spec and cleanup' | |
task :spec => :test do | |
Process.kill(:INT, @pid) | |
end | |
task :test => :start_server | |
task :start_server do | |
@pid = spawn('python', '-m', 'SimpleHTTPServer', :out => '/dev/null', :err => [:child, :out]) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment