Running the Test Suite
With the test written, all that's left to do is run it, in one of two ways. The first is in the browser. To do that, we can start the server with which Konacha ships:
> rake konacha:serve
That command starts a server on port 3500. If you then navigate to http://localhost:3500, you should be greeted with a screen that looks something like Figure 1.
When we go to http://localhost:3500, it will run the entire test suite we've written—in this case, just the one test. However, if we want to run just this one file, we can do it by visiting http://localhost:3500/greeter_spec, as shown in Figure 2.
Running the test suite is really fast, but often it's nice to be able to run the specs in the background, using a tool such as Guard, or as part of your continuous integration server. To do this, we can run the following rake task:
> rake konacha:run
Finished in 3.51 seconds 1 examples, 0 failures
Unfortunately, having Firefox popping up continually while you're trying to work isn't very nice. This also won't work on continuous integration servers that most likely don't have Firefox installed. How do we solve this problem? We need to install a headless web browser.