~dricottone/my-utils

ref: ef6d4cd1b378cc0ebbcb6e1460b3909f0cdd71b6 my-utils/core/test/wttr.bats -rw-r--r-- 1.1 KiB
ef6d4cd1Dominic Ricottone Incomplete work on hardware/media utils 5 days ago
                                                                                
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
bats_require_minimum_version 1.5.0

@test "wttr version" {
  run --separate-stderr wttr --version
  [ "$status" -eq 0 ]
  [ "$output" = "wttr 1.1" ]
  [ "$stderr" = "" ]
}

@test "wttr version short" {
  run --separate-stderr wttr -v
  [ "$status" -eq 0 ]
  [ "$output" = "wttr 1.1" ]
  [ "$stderr" = "" ]
}

@test "wttr help" {
  run --separate-stderr wttr --help
  [ "$status" -eq 0 ]
  [ "${lines[0]}" = "Wrapper around 'wego' to fix double-wide runes for some fonts" ]
  [ "${lines[1]}" = "Usage: wttr" ]
  [ "${lines[2]}" = "Options:" ]
  [ "${lines[3]}" = " -h, --help     print this message and exit" ]
  [ "${lines[4]}" = " -v, --version  print version number and exit" ]
  [ "$stderr" = "" ]
}

@test "wttr help short" {
  run --separate-stderr wttr -h
  [ "$status" -eq 0 ]
  [ "${lines[0]}" = "Wrapper around 'wego' to fix double-wide runes for some fonts" ]
  [ "${lines[1]}" = "Usage: wttr" ]
  [ "${lines[2]}" = "Options:" ]
  [ "${lines[3]}" = " -h, --help     print this message and exit" ]
  [ "${lines[4]}" = " -v, --version  print version number and exit" ]
  [ "$stderr" = "" ]
}