Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update testing docs

  • Loading branch information...
commit 006cb19e9721d513951b3f50bf768c342ec2d707 1 parent d8b2af6
@evanmiller evanmiller authored
Showing with 10 additions and 2 deletions.
  1. +10 −2 doc-src/api-test.html
View
12 doc-src/api-test.html
@@ -4,9 +4,17 @@
&nbsp; <a href="#boss_assert">boss_assert</a></p>
<p>Chicago Boss ships with a unique functional test framework, where tests are structured as trees of continuations. All assertions are performed in callbacks, and additional tests are also performed in callbacks. For more information on the design of Boss's functional tests, see <a href="http://www.evanmiller.org/functional-tests-as-a-tree-of-continuations.html">&#8220;Functional Tests As A Tree Of Continuations&#8221;</a>.</p>
-<p>To create a test suite, create a module in the test/ directory. Your test module should export a <code>start/0</code> function, which should invoke a function from the <code>boss_web_test</code> module. This function will in turn invoke functions in the <a href="#boss_assert"><code>boss_assert</code></a> module (to run assertions) and the <a href="#boss_web_test"><code>boss_web_test</code></a> module (to run further tests).</p>
+<p>To create a test suite, create a module in the test/ directory. Your test module should export a <code>start/0</code> function, which should invoke a function from the <code>boss_web_test</code> module. This function will in turn invoke functions in the <a href="#boss_assert"><code>boss_assert</code></a> module (to run assertions) and the <a href="#boss_web_test"><code>boss_web_test</code></a> module (to run further tests). A simple example of a <code>start/0</code> function would be:</p>
-<p>When you are ready to run your test suite, type "make test" in your project directory.</p>
+<div class="code">
+ start() -&gt;<br />
+ &nbsp;&nbsp;&nbsp;boss_web_test:get_request("/", [],<br />
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[fun boss_assert:http_ok/1], []).
+</div>
+
+<p>The above test issues a GET request to the root URL, asserts that the response is 200 OK, and quits.</p>
+
+<p>When you are ready to run your test suite, type "./rebar c=test_functional" in your project directory.</p>
<a name="boss_web_test"></a>
<h3>boss_web_test</h3>
Please sign in to comment.
Something went wrong with that request. Please try again.