nushell/crates/nu-cli/tests/format_conversions/markdown.rs
Joseph T. Lyons bf2363947b
Add pretty flag to to md (#2640)
* First draft for adding a `pretty` flag to `to md`

* rustfmt

* Fix Clippy warnings

* rustfmt

* Using Clippy suggestion broken code, reverting and putting in a statement to ignore clippy warning

* Add test for `to md -p`
2020-10-15 16:20:55 +13:00

38 lines
666 B
Rust

use nu_test_support::{nu, pipeline};
#[test]
fn out_md_simple() {
let actual = nu!(
cwd: ".", pipeline(
r#"
echo 3 | to md
"#
));
assert_eq!(actual.out, "3");
}
#[test]
fn out_md_table() {
let actual = nu!(
cwd: ".", pipeline(
r#"
echo '{"name": "jason"}' | from json | to md
"#
));
assert_eq!(actual.out, "|name||-||jason|");
}
#[test]
fn out_md_table_pretty() {
let actual = nu!(
cwd: ".", pipeline(
r#"
echo '{"name": "joseph"}' | from json | to md -p
"#
));
assert_eq!(actual.out, "|name ||------||joseph|");
}