diff --git a/tests/rendered_output.rs b/tests/rendered_output.rs index a67f01f3..5cf91f66 100644 --- a/tests/rendered_output.rs +++ b/tests/rendered_output.rs @@ -334,22 +334,6 @@ fn check_link_target_fallback() { ); } -/// This makes sure you can include a Rust file with `{{#playground example.rs}}`. -/// Specification is in `guide/src/format/rust.md` -#[test] -fn able_to_include_playground_files_in_chapters() { - let temp = DummyBook::new().build().unwrap(); - let md = MDBook::load(temp.path()).unwrap(); - md.build().unwrap(); - - let second = temp.path().join("book/second.html"); - - let playground_strings = &[r#"class="playground""#, r#"println!("Hello World!");"#]; - - assert_contains_strings(&second, playground_strings); - assert_doesnt_contain_strings(&second, &["{{#playground example.rs}}"]); -} - #[test] fn example_book_can_build() { let example_book_dir = dummy_book::new_copy_of_example_book().unwrap(); diff --git a/tests/testsuite/includes.rs b/tests/testsuite/includes.rs index d63be13c..c7c28a1a 100644 --- a/tests/testsuite/includes.rs +++ b/tests/testsuite/includes.rs @@ -68,3 +68,19 @@ Around the world, around the world

"#]], ); } + +// Checks the behavior of `{{#playground}}` include. +#[test] +fn playground_include() { + BookTest::from_dir("includes/all_includes") + .check_main_file("book/playground.html", + str![[r##" +

Playground Includes

+
fn main() {
+    println!("Hello World!");
+
+   // You can even hide lines! :D
+  println!("I am hidden! Expand the code snippet to see me");
+}
+"##]]); +}