File: request.rs

package info (click to toggle)
rust-just 1.43.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 2,068 kB
  • sloc: sh: 300; makefile: 6
file content (29 lines) | stat: -rw-r--r-- 561 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use super::*;

#[test]
fn environment_variable_set() {
  Test::new()
    .justfile(
      r#"
      export BAR := 'baz'

      @foo:
        '{{just_executable()}}' --request '{"environment-variable": "BAR"}'
    "#,
    )
    .response(Response::EnvironmentVariable(Some("baz".into())))
    .run();
}

#[test]
fn environment_variable_missing() {
  Test::new()
    .justfile(
      r#"
      @foo:
        '{{just_executable()}}' --request '{"environment-variable": "FOO_BAR_BAZ"}'
    "#,
    )
    .response(Response::EnvironmentVariable(None))
    .run();
}