matlab.unittest.fixtures.WorkingFolderFixture Class
Namespace: matlab.unittest.fixtures
Fixture for creating and changing to temporary working folder
Description
The matlab.unittest.fixtures.WorkingFolderFixture
creates
a temporary folder and sets it as the current working folder. The
test or the product under test can create files and modify the contents
of the folder without affecting the source code or test folder structure.
When the testing framework sets up the fixture, it adds the current folder to the path. Then, the fixture creates a temporary folder, and changes the current working folder to the temporary folder. When the testing framework tears down the fixture, by default, it deletes the temporary folder and all folder contents. The testing framework restores the current working folder to its previous state.
Both the WorkingFolderFixture
and TemporaryFolderFixture
fixtures
create a temporary folder. However, the WorkingFolderFixture
also
sets the folder as the current working folder.
Construction
matlab.unittest.fixtures.WorkingFolderFixture
constructs
a fixture for creating and changing to a temporary working folder.
matlab.unittest.fixtures.WorkingFolderFixture(
constructs
a fixture with additional options specified by one or more Name,Value
)Name,Value
pair
arguments. For example, matlab.unittest.fixtures.WorkingFolderFixture('PreservingOnFailure',true)
constructs
a fixture that does not delete the temporary folder in the event of
an error.
Input Arguments
Properties
Copy Semantics
Handle. To learn how handle classes affect copy operations, see Copying Objects.
Examples
Version History
Introduced in R2016a