add description of stdout_check/stderr_check

This commit is contained in:
Johan Holmberg 2018-04-12 17:42:42 +02:00
parent 82c329da9e
commit 734abd4fea
2 changed files with 30 additions and 2 deletions

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils 0.14: http://docutils.sourceforge.net/" />
<title>Cmdtest User Guide</title>
<style type="text/css">
@ -870,6 +870,20 @@ in recent versions of JUnit).</dd>
<dd>&quot;touch&quot; a file inside the &quot;work directory&quot;.
The filename is evaluated relative to the current directory at the
time of the call.</dd>
<dt><tt class="docutils literal">stdout_check()</tt></dt>
<dd><p class="first">Will &quot;callback&quot; to the test script, giving the user a chance to inpect STDOUT,
and maybe call &quot;assert&quot;. Example:</p>
<pre class="last literal-block">
cmd &quot;seq 0 5 100&quot; do
stdout_check do |lines|
assert lines.include?(55), &quot;no line '55'&quot;
end
end
</pre>
</dd>
<dt><tt class="docutils literal">stdout_check()</tt></dt>
<dd>Will &quot;callback&quot; to the test script, giving the user a chance to inpect STDERR,
and maybe call &quot;assert&quot; (see <tt class="docutils literal">stdout_check()</tt> above).</dd>
</dl>
</div>
<div class="section" id="deprecated-helper-functions">
@ -898,7 +912,7 @@ time of the call.</dd>
<div class="footer">
<hr class="footer" />
<a class="reference external" href="cmdtest.txt">View document source</a>.
Generated on: 2016-11-08.
Generated on: 2018-04-12.
Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>

@ -611,6 +611,20 @@ or in the ``setup`` method.
The filename is evaluated relative to the current directory at the
time of the call.
``stdout_check()``
Will "callback" to the test script, giving the user a chance to inpect STDOUT,
and maybe call "assert". Example::
cmd "seq 0 5 100" do
stdout_check do |lines|
assert lines.include?(55), "no line '55'"
end
end
``stdout_check()``
Will "callback" to the test script, giving the user a chance to inpect STDERR,
and maybe call "assert" (see ``stdout_check()`` above).
Deprecated helper functions
+++++++++++++++++++++++++++