From 92e96b39fd762a1a9ea0f163141b22bf6136b949 Mon Sep 17 00:00:00 2001 From: Jack Wright Date: Tue, 2 Jul 2024 12:53:31 -0700 Subject: [PATCH] Added an example test for `metadata set --content-type` --- crates/nu-command/src/debug/metadata_set.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/nu-command/src/debug/metadata_set.rs b/crates/nu-command/src/debug/metadata_set.rs index be316d893d..e4ee97a76b 100644 --- a/crates/nu-command/src/debug/metadata_set.rs +++ b/crates/nu-command/src/debug/metadata_set.rs @@ -89,7 +89,7 @@ impl Command for MetadataSet { Example { description: "Set the metadata of a file path", example: "'crates' | metadata set --content-type text/plain | metadata", - result: None, + result: Some(Value::record(record!("content_type" => Value::string("text/plain", Span::test_data())), Span::test_data())), }, ] } @@ -97,12 +97,12 @@ impl Command for MetadataSet { #[cfg(test)] mod test { + use crate::{test_examples_with_commands, Metadata}; + use super::*; #[test] fn test_examples() { - use crate::test_examples; - - test_examples(MetadataSet {}) + test_examples_with_commands(MetadataSet {}, &[&Metadata {}]) } }