Skip to content
This repository has been archived by the owner on Feb 12, 2018. It is now read-only.

Watch to Reload Spin Server #3

Open
vizjerai opened this issue Nov 17, 2011 · 3 comments
Open

Watch to Reload Spin Server #3

vizjerai opened this issue Nov 17, 2011 · 3 comments

Comments

@vizjerai
Copy link
Owner

There is no way of telling Guard-Spin to reload the spin server and there are some files if changed should force the spin server to reload.

@carlosramireziii
Copy link

This is an interesting question. This gem currently handles both starting the server as well as pushing tests to the server to be run. Contrast that to the guard-spork gem which is only responsible for starting/restarting the spork server; in order to run the tests, you need to use a separate guard gem (e.g. guard-rspec) to run tests on the spork server.

We could definitely think of a workaround to implement this behavior, but I'm wondering if this single gem should really be split into two: (1) a gem that starts/restarts the spin server (2) a gem that pushes tests to the spin server.

# this gem will start and restart the server when certain files are changed
guard 'spin-server' do
  watch('Gemfile')
  watch('test/test_helper.rb')
  watch('spec/spec_helper.rb')
  # etc.
end

# this gem will push tests to the spin server
guard 'spin-pusher' do
  watch(%r{^spec/.+_spec\.rb$}) # rspec
  watch(%r|^test/(.*)_test\.rb$|) # testunit
  # etc.
end

I suppose they could even be part of this same gem, just split into two separate guards. What do you think?

@vizjerai
Copy link
Owner Author

With the way guard works and to make this actually work where the spin server would automatically be restarted when certain files are changed would require it to be in 2 gems, or at least 2 different guards as you suggest.

I haven't had the time to rework this gem to support this but thanks for your input.

@aspiers
Copy link

aspiers commented Mar 16, 2013

I don't think guard-spin should be responsible for running tests at all. It should work like guard-spork and only be responsible for restarting the spin server, otherwise you are reinventing the wheel of functionality already in guard-rspec and guard-minitest. A better approach is to patch guard-rspec / guard-minitest to add support for running tests via spin push. This has the advantage that these guards can go in separate group scopes within the guard file, so that by narrowing guard to (say) the rspec group, you could have only the rspecs being run, but the spin server would still get restarted when necessary. I might look into patching these now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants