Merge pull request #2785 from ehuss/ensure-test-built

Don't rebuild books in tests
This commit is contained in:
Eric Huss 2025-08-12 02:27:02 +00:00 committed by GitHub
commit b09c588ca9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -231,6 +231,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
}