aboutsummaryrefslogtreecommitdiffstats
path: root/tests/generate-command.bats
blob: 2a30cd0d7f397a05d4993ca6e9c5ba9db76772e0 (plain)
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
#!/usr/bin/env bats

setup() {
   export TERMINAL_COMMAND='urxvt -e'
}

@test "Exec command is properly extracted from Firefox desktop file" {
  run ../sway-launcher-desktop.sh generate-command data/desktop-files/0/applications/firefox.desktop
  [ "$status" -eq 0 ]
  [[ "$output" ==  '/usr/lib/firefox/firefox' ]]
}

@test "Exec command is properly generated from htop desktop file" {
  run ../sway-launcher-desktop.sh generate-command data/desktop-files/0/applications/htop.desktop
  expected='urxvt -e htop'
  echo "EXPECTED: $expected"
  echo "ACTUAL: $output"
  [ "$status" -eq 0 ]
  [[ "$output" ==  $expected ]]
}

@test "Exec command is properly generated from minecraft-launcher desktop file" {
  run ../sway-launcher-desktop.sh generate-command data/desktop-files/0/applications/minecraft-launcher.desktop
  [ "$status" -eq 0 ]
  [[ "$output" ==  'cd /opt/minecraft-launcher/ && env GDK_BACKEND=x11 /opt/minecraft-launcher/minecraft-launcher' ]]
}