guard / guard-minitest

Guard::Minitest automatically run your tests (much like autotest)
https://rubygems.org/gems/guard-minitest
MIT License
248 stars 88 forks source link

Spring command not going trough its socket? #157

Open emilebosch opened 5 years ago

emilebosch commented 5 years ago

Maybe I am understanding it wrong. But isn't the spring command supposed to go trough the spring socket. Now it needs to escape to a shell, boot ruby, to finally pass trough the spring socket. Seems a bit unnecessary in terms of milliseconds or am I wrong?

Thanks a lot

The runner code:

https://github.com/guard/guard-minitest/blob/master/lib/guard/minitest/runner.rb

And how the spring client talks to spring

https://github.com/rails/spring/blob/master/lib/spring/client/run.rb#L26
emilebosch commented 5 years ago

Aaaaaand here is the guard free patch 😗

task :yolo => :environment do
  Thread::abort_on_exception = true
  listener = Listen.to("test/") do |modified, added, removed|
    begin
      Spring::Client::run(["rails","test"])
    rescue SystemExit
      puts "Lol rly?"
    end
  end
  listener.start
  puts "Watching for test changes"
  sleep
end