Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compare Pros and Cons of Autofeature/autotest vs Guard?

Does anyone have any concrete reasoning for using one autotesting runner over another? I've used both Autofeature+autotest, I really like the built-in process that this sets up in that it runs my rspec unit tests first, and then the cucumber tests, and only the last failing test - it lends itself to the standard workflow of writing the cucumber tests, setting up the steps until they fail and then dropping down into unit tests for the detailed functionality.

I've used guard in the standard rspec configuration and it's worked well also, but I didn't fold in the cucumber tests - didn't have time to experiment further.

Just wondering if anyone has any specific reasons for using one over another, or whether one way mitigates a weakness of the other.

Thanks for the input, Tony

like image 902
Tonys Avatar asked Aug 28 '11 17:08

Tonys


1 Answers

I recently moved from autotest to guard for a reason, it works better than autotest and it has a lot of available guards. So with a single process you can monitor a lot of things.

Currently I use it for Rspec, Passenger, and Yard but the list is very long and you can always implement your guard if you need it for something else.

I find it very useful especially for passenger when developing because it will reload the server as soon as you change something which need the server restarted (i.e. routes, config, etc).

Some of the available guards can be replaced in some way, for example with yard you can launch it's own server, but then you need two different process, with guard you can do all the work with a single process.

In other words Guard is more a generic Framework for every process which needs to do something triggered by a file change, autotest is restricted to running tests.

Update

In response to your comment

You can randomize spec order by using --rand in your .rspec file if you have Rspec > 2.8. In this way that is achieved at rspec order and it works also when you call rspec with rake or with rspec executable.

For less files there is guard-less.

Moreover latest versions of guard also embed a Rails console with pry available when guard is idle, very useful in development mode.

like image 174
Fabio Avatar answered Oct 18 '22 05:10

Fabio