-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for building corelib docs (#1687)
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use assert_fs::TempDir; | ||
use scarb_metadata::Metadata; | ||
use scarb_test_support::command::{CommandExt, Scarb}; | ||
use scarb_test_support::project_builder::ProjectBuilder; | ||
|
||
#[test] | ||
fn can_doc_corelib() { | ||
let t = TempDir::new().unwrap(); | ||
// Find path to corelib. | ||
ProjectBuilder::start().name("hello").build(&t); | ||
let metadata = Scarb::quick_snapbox() | ||
.args(["--json", "metadata", "--format-version", "1"]) | ||
.current_dir(&t) | ||
.stdout_json::<Metadata>(); | ||
let core = metadata.packages.iter().find(|p| p.name == "core").unwrap(); | ||
let core = core.root.clone(); | ||
// Doc corelib. | ||
Scarb::quick_snapbox() | ||
.arg("doc") | ||
.current_dir(core) | ||
.assert() | ||
.success(); | ||
} |