Cob Spec is a suite of tests used to validate a web server to ensure it adheres to HTTP specifications. These acceptance tests were created using a testing suite called FitNesse. FitNesse is an application testing suite that allows you to test the business layer of your application.
To test your server against the Cob Spec suite of tests, follow the instructions below.
git clone [email protected]:8thlight/cob_spec.git
git clone [email protected]:marosluuce/rubyslim.git
cd cob_spec
bundle install
Start the Fitnesse server on port 9090.
java -jar fitnesse.jar -p 9090
Open your browser and go to http://localhost:9090. You should see the Cob Spec website.
To run the tests you have to change three variables.
- Navigate to the HttpTestSuite.
- Click on Edit.
- Update the paths for the User-Defined Variables.
TEST_RUNNER
is the path to the ruby slim executable in your clone of the rubyslim repository on your machine.- Example:
/User/somebody/rubyslim/bin/rubyslim
- Example:
SERVER_START_COMMAND
is the command to start your server.- Example:
java -jar /User/somebody/project/my_jar.jar
- Example:
PUBLIC_DIR
is the path to cob spec public folder.- Example:
/User/somebody/cob_spec/public/
- Example:
- Click Save.
Your server jar needs to take two command line arguments.
-p
which specifies the port to listen on. Default is5000
.-d
which specifies the directory to serve files from. Default is thePUBLIC_DIR
variable.
- To run all tests, click the Suite button.
- To run the simple http request tests, first click the ResponseTestSuite link, then click the Suite button.
- To run the tests that require threading, first click the SimultaniousTestSuite link, then click the Suite button.
- To run a test individually, first click on the test link, then click the Test button.