Document "changed_files" instead of "modified_files".

This commit is contained in:
Johan Holmberg
2009-05-10 21:49:10 +00:00
committed by holmberg556
parent d6817779c8
commit c4acd10b1e
2 changed files with 15 additions and 15 deletions

View File

@ -449,14 +449,14 @@ cmd "true" do
stdout_equal "" stdout_equal ""
stderr_equal "" stderr_equal ""
created_files [] created_files []
modified_files [] changed_files []
removed_files [] removed_files []
end end
</pre> </pre>
<p>The idea is that all differences in behaviour from the trivial <tt class="docutils literal"><span class="pre">true</span></tt> <p>The idea is that all differences in behaviour from the trivial <tt class="docutils literal"><span class="pre">true</span></tt>
command should be described as an assertion in the do-block. The list command should be described as an assertion in the do-block. The list
of possible assertions includes: <tt class="docutils literal"><span class="pre">exit_zero</span></tt>, <tt class="docutils literal"><span class="pre">exit_nonzero</span></tt>, of possible assertions includes: <tt class="docutils literal"><span class="pre">exit_zero</span></tt>, <tt class="docutils literal"><span class="pre">exit_nonzero</span></tt>,
<tt class="docutils literal"><span class="pre">exit_status</span></tt>, <tt class="docutils literal"><span class="pre">created_files</span></tt>, <tt class="docutils literal"><span class="pre">modified_files</span></tt>, <tt class="docutils literal"><span class="pre">removed_files</span></tt>, <tt class="docutils literal"><span class="pre">exit_status</span></tt>, <tt class="docutils literal"><span class="pre">created_files</span></tt>, <tt class="docutils literal"><span class="pre">changed_files</span></tt>, <tt class="docutils literal"><span class="pre">removed_files</span></tt>,
<tt class="docutils literal"><span class="pre">written_files</span></tt>, <tt class="docutils literal"><span class="pre">affected_files</span></tt>, <tt class="docutils literal"><span class="pre">file_equal</span></tt>, <tt class="docutils literal"><span class="pre">stdout_equal</span></tt> <tt class="docutils literal"><span class="pre">written_files</span></tt>, <tt class="docutils literal"><span class="pre">affected_files</span></tt>, <tt class="docutils literal"><span class="pre">file_equal</span></tt>, <tt class="docutils literal"><span class="pre">stdout_equal</span></tt>
and <tt class="docutils literal"><span class="pre">stderr_equal</span></tt>.</p> and <tt class="docutils literal"><span class="pre">stderr_equal</span></tt>.</p>
<p>In addition to the assertions there are other helper-functions to set <p>In addition to the assertions there are other helper-functions to set
@ -616,21 +616,21 @@ exit-related methods have been called.</dd>
<dt><tt class="docutils literal"><span class="pre">affected_files(file1,...,fileN)</span></tt></dt> <dt><tt class="docutils literal"><span class="pre">affected_files(file1,...,fileN)</span></tt></dt>
<dd>The specified files should have been created, removed or modified by the <dd>The specified files should have been created, removed or modified by the
command. This assertion can be used when it doesn't matter which command. This assertion can be used when it doesn't matter which
of <tt class="docutils literal"><span class="pre">created_files</span></tt>, <tt class="docutils literal"><span class="pre">removed_files</span></tt> or <tt class="docutils literal"><span class="pre">modified_files</span></tt> that apply of <tt class="docutils literal"><span class="pre">created_files</span></tt>, <tt class="docutils literal"><span class="pre">removed_files</span></tt> or <tt class="docutils literal"><span class="pre">changed_files</span></tt> that apply
(cf. <tt class="docutils literal"><span class="pre">written_files</span></tt>).</dd> (cf. <tt class="docutils literal"><span class="pre">written_files</span></tt>).</dd>
<dt><tt class="docutils literal"><span class="pre">created_files(file1,...,fileN)</span></tt></dt> <dt><tt class="docutils literal"><span class="pre">changed_files(file1,...,fileN)</span></tt></dt>
<dd>The specified files should have been created by the command.</dd>
<dt><tt class="docutils literal"><span class="pre">modified_files(file1,...,fileN)</span></tt></dt>
<dd>The specified files should have been modified by the command. A <dd>The specified files should have been modified by the command. A
file is considered modified if it existed before the command, and file is considered modified if it existed before the command, and
something about the file has changed after the command (inode something about the file has changed after the command (inode
number, modification date or content).</dd> number, modification date or content).</dd>
<dt><tt class="docutils literal"><span class="pre">created_files(file1,...,fileN)</span></tt></dt>
<dd>The specified files should have been created by the command.</dd>
<dt><tt class="docutils literal"><span class="pre">removed_files(file1,...,fileN)</span></tt></dt> <dt><tt class="docutils literal"><span class="pre">removed_files(file1,...,fileN)</span></tt></dt>
<dd>The specified files should have been removed by the command.</dd> <dd>The specified files should have been removed by the command.</dd>
<dt><tt class="docutils literal"><span class="pre">written_files(file1,...,fileN)</span></tt></dt> <dt><tt class="docutils literal"><span class="pre">written_files(file1,...,fileN)</span></tt></dt>
<dd>The specified files should have been created or modified by the <dd>The specified files should have been created or modified by the
command. This assertion can be used when it doesn't matter which command. This assertion can be used when it doesn't matter which
of <tt class="docutils literal"><span class="pre">created_files</span></tt> or <tt class="docutils literal"><span class="pre">modified_files</span></tt> that apply. A typical scenario is of <tt class="docutils literal"><span class="pre">created_files</span></tt> or <tt class="docutils literal"><span class="pre">changed_files</span></tt> that apply. A typical scenario is
in a test method where repeated operations are done on the same in a test method where repeated operations are done on the same
file. By using <tt class="docutils literal"><span class="pre">written_files</span></tt> we don't have to treat the first file. By using <tt class="docutils literal"><span class="pre">written_files</span></tt> we don't have to treat the first
case special (when the file is created).</dd> case special (when the file is created).</dd>

View File

@ -144,14 +144,14 @@ following more explicit one::
stdout_equal "" stdout_equal ""
stderr_equal "" stderr_equal ""
created_files [] created_files []
modified_files [] changed_files []
removed_files [] removed_files []
end end
The idea is that all differences in behaviour from the trivial ``true`` The idea is that all differences in behaviour from the trivial ``true``
command should be described as an assertion in the do-block. The list command should be described as an assertion in the do-block. The list
of possible assertions includes: ``exit_zero``, ``exit_nonzero``, of possible assertions includes: ``exit_zero``, ``exit_nonzero``,
``exit_status``, ``created_files``, ``modified_files``, ``removed_files``, ``exit_status``, ``created_files``, ``changed_files``, ``removed_files``,
``written_files``, ``affected_files``, ``file_equal``, ``stdout_equal`` ``written_files``, ``affected_files``, ``file_equal``, ``stdout_equal``
and ``stderr_equal``. and ``stderr_equal``.
@ -318,25 +318,25 @@ Assertions - files
``affected_files(file1,...,fileN)`` ``affected_files(file1,...,fileN)``
The specified files should have been created, removed or modified by the The specified files should have been created, removed or modified by the
command. This assertion can be used when it doesn't matter which command. This assertion can be used when it doesn't matter which
of ``created_files``, ``removed_files`` or ``modified_files`` that apply of ``created_files``, ``removed_files`` or ``changed_files`` that apply
(cf. ``written_files``). (cf. ``written_files``).
``created_files(file1,...,fileN)`` ``changed_files(file1,...,fileN)``
The specified files should have been created by the command.
``modified_files(file1,...,fileN)``
The specified files should have been modified by the command. A The specified files should have been modified by the command. A
file is considered modified if it existed before the command, and file is considered modified if it existed before the command, and
something about the file has changed after the command (inode something about the file has changed after the command (inode
number, modification date or content). number, modification date or content).
``created_files(file1,...,fileN)``
The specified files should have been created by the command.
``removed_files(file1,...,fileN)`` ``removed_files(file1,...,fileN)``
The specified files should have been removed by the command. The specified files should have been removed by the command.
``written_files(file1,...,fileN)`` ``written_files(file1,...,fileN)``
The specified files should have been created or modified by the The specified files should have been created or modified by the
command. This assertion can be used when it doesn't matter which command. This assertion can be used when it doesn't matter which
of ``created_files`` or ``modified_files`` that apply. A typical scenario is of ``created_files`` or ``changed_files`` that apply. A typical scenario is
in a test method where repeated operations are done on the same in a test method where repeated operations are done on the same
file. By using ``written_files`` we don't have to treat the first file. By using ``written_files`` we don't have to treat the first
case special (when the file is created). case special (when the file is created).