Skip to content

Commit

Permalink
Add test for building corelib docs (#1687)
Browse files Browse the repository at this point in the history
  • Loading branch information
maciektr authored Oct 25, 2024
1 parent d3929e1 commit 49a2803
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions extensions/scarb-doc/tests/core.rs
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();
}

0 comments on commit 49a2803

Please sign in to comment.