Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions test/root.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bats

load test_helper

@test "root command shows help when no subcommand provided" {
run pomodoro

[ "$status" -eq 0 ]
[[ "$output" =~ "A simple Pomodoro command-line client" ]]
[[ "$output" =~ "Usage:" ]]
[[ "$output" =~ "Available Commands:" ]]
}

@test "root command --help produces same output as no subcommand" {
run pomodoro
no_subcommand_output="$output"

run pomodoro --help
help_flag_output="$output"

[ "$no_subcommand_output" = "$help_flag_output" ]
}

@test "root command help subcommand shows help output" {
run pomodoro help

[ "$status" -eq 0 ]
[[ "$output" =~ "A simple Pomodoro command-line client" ]]
[[ "$output" =~ "Usage:" ]]
[[ "$output" =~ "Available Commands:" ]]
}