Don't rebuild books in tests
This fixes an issue where the `check` methods would inadvertently rebuild the books if the `mdbook build` command is run. Normally this isn't too much of an issue unless the `build` command is run with options that affect the output.
This commit is contained in:
parent
4a2d3a7e85
commit
824e2a7681
1 changed files with 6 additions and 0 deletions
|
|
@ -230,6 +230,12 @@ impl BookTest {
|
|||
};
|
||||
f(&mut cmd);
|
||||
cmd.run();
|
||||
// Ensure that `built` gets set if a build command is used so that all
|
||||
// the `check` methods do not overwrite the contents of what was just
|
||||
// built.
|
||||
if cmd.args.first().map(String::as_str) == Some("build") {
|
||||
self.built = true
|
||||
}
|
||||
self
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue