Skip to content

Commit

Permalink
d Regenerate docs
Browse files Browse the repository at this point in the history
  • Loading branch information
claremacrae committed Aug 30, 2021
1 parent 65843f7 commit a450e07
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
20 changes: 18 additions & 2 deletions doc/Writers.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

* [Default Behaviour](#default-behaviour)
* [Using custom writers](#using-custom-writers)
* [Using custom filename extensions](#using-custom-filename-extensions)<!-- endToc -->
* [Using custom filename extensions](#using-custom-filename-extensions)
* [Creating Empty Files](#creating-empty-files)<!-- endToc -->

## Default Behaviour

Expand Down Expand Up @@ -55,7 +56,22 @@ By default, ApprovalTests will create an empty file as a text file with an empty

This behavior can be customized as follows which will create a valid empty json file when running a new ApprovalTest:

snippet: use_empty_file_creator
<!-- snippet: use_empty_file_creator -->
<a id='snippet-use_empty_file_creator'></a>
```cpp
ApprovalTests::EmptyFileCreator jsonCreator = [](std::string fileName) {
std::string contents = "";
if (ApprovalTests::StringUtils::endsWith(fileName, ".json"))
{
contents = "{}";
}
ApprovalTests::StringWriter s(contents);
s.write(fileName);
};
auto disposer = ApprovalTests::FileUtils::useEmptyFileCreator(jsonCreator);
```
<sup><a href='/tests/DocTest_Tests/utilities/FileUtilsExamples.cpp#L9-L20' title='Snippet source file'>snippet source</a> | <a href='#snippet-use_empty_file_creator' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

---

Expand Down
4 changes: 2 additions & 2 deletions doc/how_tos/ToggleDeprecatedCode.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Or this to your CMakeLists.txt:
# Replace ${PROJECT_NAME} with the name of your test executable:
target_compile_definitions(${PROJECT_NAME} PRIVATE -DAPPROVAL_TESTS_SHOW_DEPRECATION_WARNINGS=1)
```
<sup><a href='/tests/DocTest_Tests/CMakeLists.txt#L71-L74' title='Snippet source file'>snippet source</a> | <a href='#snippet-show_deprecation_warnings_cmake' title='Start of snippet'>anchor</a></sup>
<sup><a href='/tests/DocTest_Tests/CMakeLists.txt#L72-L75' title='Snippet source file'>snippet source</a> | <a href='#snippet-show_deprecation_warnings_cmake' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

### Hide deprecated code
Expand All @@ -75,7 +75,7 @@ Or this to your CMakeLists.txt:
# Replace ${PROJECT_NAME} with the name of your test executable:
target_compile_definitions(${PROJECT_NAME} PRIVATE -DAPPROVAL_TESTS_HIDE_DEPRECATED_CODE=1)
```
<sup><a href='/tests/DocTest_Tests/CMakeLists.txt#L76-L79' title='Snippet source file'>snippet source</a> | <a href='#snippet-hide_deprecated_code_cmake' title='Start of snippet'>anchor</a></sup>
<sup><a href='/tests/DocTest_Tests/CMakeLists.txt#L77-L80' title='Snippet source file'>snippet source</a> | <a href='#snippet-hide_deprecated_code_cmake' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

## How to Update Calls to Deprecated Code
Expand Down

0 comments on commit a450e07

Please sign in to comment.