Ruby On Rails Classroom image

Anil  Bist / Professional / Web Technology

 
To post your Question Join Classroom
 
Lesson Topics's No:-  First|1 | 2 | 3 | 4|
Lessons:- Speeding up Tests with Spork

One word of advice when using Spork: After changing a file included in the prefork loading (such as routes.rb), you will have to restart the Spork server to load the new Rails environment. If your tests are failing when you think they should be passing, quit the Spork server with Control-C and restart it:

 

Guard with Spork
Spork is especially useful when used with Guard, which we can arrange as follows: 

$ bundle exec guard init spork

              

We then need to change the Guardfile as in Listing 3.38. 

 

Note that we’ve updated the arguments to guard to include :cli => --drb, which ensures that Guard uses the command-line interface (cli) to the Spork server. We’ve also added a command to watch the spec/support/ directory, which we’ll start modifying in Chapter 5.  

            With that configuration in place, we can start Guard and Spork at the same time with the guard command

$ bundle exec guard

                      Guard automatically starts a Spork server, dramatically reducing the overhead each time a test gets run. A well-configured testing environment with Guard, Spork, and (optionally) test notifications makes test-driven development positively addictive. See the Rails Tutorial screencasts18 for more information.

 
 
 
image
Anil  Bist

Skills    Ruby On Rails

Qualifications :- High School - SLV, College/University - Graphic Era Deemed Univ University,
Location :-Dehradun,Dehradun,Uttarakhand,India
Description:-

I started my Professional Journey in 2006 with one of the Web Development Company in Bangalore and my 1st framework was "Ruby on Rail" as Web development and delivered around 5+ Projects using this platform. Then came another dimension as JEE/Sturst framework, Gradually I realized that I want to build something on my own and give my passion and energy on creating something different a
Explore

 

  Students (0)