File: test.bats

package info (click to toggle)
gcalcli 4.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,376 kB
  • sloc: python: 4,135; makefile: 10; sh: 7
file content (42 lines) | stat: -rw-r--r-- 761 bytes parent folder | download
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
40
41
42
setup() {
  load 'test_helper/bats-support/load'
  load 'test_helper/bats-assert/load'
  load 'test_helper/bats-file/load'
  load 'test_helper/bats-snapshot/load'

  TEST_HOME_DIR="$(temp_make)"
  export HOME="$TEST_HOME_DIR"
  export GCALCLI_USERLESS_MODE=1
}

function teardown() {
  temp_del "$TEST_HOME_DIR"
}

@test "can run" {
  run gcalcli
  assert_failure 2
  assert_output --regexp 'usage: .*error:.*required: .*command'
}

@test "prints correct help" {
  GCALCLI_CONFIG=/some/gcalcli/config COLUMNS=72 run gcalcli -h
  assert_success
  assert_snapshot
}

@test "can run init" {
  run gcalcli init --client-id=SOME_CLIENT <<< "SOME_SECRET
"
  assert_snapshot
}

@test "can run add" {
  run gcalcli add <<< "sometitle

tomorrow


."
  assert_snapshot
}