just/tests
2021-05-16 00:33:41 -05:00
..
choose.rs Allow choosing multiple recipes to run (#700) 2020-10-10 17:54:58 -07:00
command.rs Add the --command subcommand (#824) 2021-05-10 03:35:35 +00:00
common.rs Add the --command subcommand (#824) 2021-05-10 03:35:35 +00:00
completions.rs Don't require justfile to print completions (#596) 2020-02-20 06:07:25 -08:00
conditional.rs Add conditional expressions (#714) 2020-10-26 18:16:42 -07:00
delimiters.rs Allow ignore line endings inside delimiters (#717) 2020-10-27 23:51:17 -07:00
dotenv.rs Disable .env warning for now 2021-03-30 17:59:15 -07:00
edit.rs Add the --choose subcommand (#680) 2020-09-17 19:43:04 -07:00
error_messages.rs Add conditional expressions (#714) 2020-10-26 18:16:42 -07:00
evaluate.rs Change --eval to print variable value only (#806) 2021-04-25 17:02:57 -07:00
examples.rs Test that example justfiles successfully parse (#643) 2020-06-09 22:57:16 -07:00
export.rs Add dotenv-load setting (#778) 2021-03-28 22:38:07 -07:00
init.rs Add missing --init test (#543) 2019-11-20 01:35:29 -06:00
interrupts.rs Add the --command subcommand (#824) 2021-05-10 03:35:35 +00:00
invocation_directory.rs Note shebang line splitting inconsistency in readme (#757) 2021-02-15 01:18:31 -08:00
lib.rs Add .exe to powershell scripts (#826) 2021-05-11 12:21:49 -07:00
misc.rs Reform and improve string literals (#793) 2021-04-05 21:28:37 -07:00
positional_arguments.rs Pass evaluated arguments as positional arguments (#810) 2021-05-02 10:25:43 +00:00
quiet.rs Turn = deprecation warning into a hard error (#780) 2021-03-28 23:39:23 -07:00
readme.rs
search.rs
shebang.rs Add shebang support for 'cmd.exe' (#828) 2021-05-16 00:33:41 -05:00
shell.rs Add dotenv-load setting (#778) 2021-03-28 22:38:07 -07:00
string.rs Reform and improve string literals (#793) 2021-04-05 21:28:37 -07:00
test.rs Warn if .env file loaded and dotenv-load unset (#784) 2021-03-30 17:30:32 -07:00
working_directory.rs Wrap comments at 80 characters (#593) 2020-02-14 04:49:25 -08:00

use std::{fs, process::Command};

use executable_path::executable_path;
use test_utilities::{assert_success, tempdir};

#[test]
fn readme() {
  let mut justfiles = vec![];
  let mut current = None;

  for line in fs::read_to_string("README.adoc").unwrap().lines() {
    if let Some(mut justfile) = current {
      if line == "```" {
        justfiles.push(justfile);
        current = None;
      } else {
        justfile += line;
        justfile += "\n";
        current = Some(justfile);
      }
    } else if line == "```make" {
      current = Some(String::new());
    }
  }

  for justfile in justfiles {
    let tmp = tempdir();

    let path = tmp.path().join("justfile");

    fs::write(&path, &justfile).unwrap();

    let output = Command::new(executable_path("just"))
      .current_dir(tmp.path())
      .arg("--dump")
      .output()
      .unwrap();

    assert_success(&output);
  }
}