File: commands.bats

package info (click to toggle)
pyenv 2.5.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,176 kB
  • sloc: sh: 4,727; python: 402; makefile: 70; ansic: 60
file content (39 lines) | stat: -rw-r--r-- 693 bytes parent folder | download | duplicates (2)
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
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bats

load test_helper

@test "commands" {
  run pyenv-commands
  assert_success
  assert_line "init"
  assert_line "rehash"
  assert_line "shell"
  refute_line "sh-shell"
  assert_line "echo"
}

@test "commands --sh" {
  run pyenv-commands --sh
  assert_success
  refute_line "init"
  assert_line "shell"
}

@test "commands in path with spaces" {
  path="${PYENV_TEST_DIR}/my commands"
  cmd="${path}/pyenv-sh-hello"
  mkdir -p "$path"
  touch "$cmd"
  chmod +x "$cmd"

  PATH="${path}:$PATH" run pyenv-commands --sh
  assert_success
  assert_line "hello"
}

@test "commands --no-sh" {
  run pyenv-commands --no-sh
  assert_success
  assert_line "init"
  refute_line "shell"
}