Files
docker-machine/test/integration/cli.bats
T

107 lines
2.0 KiB
Bash
Raw Normal View History

2015-02-25 17:41:02 -05:00
#!/usr/bin/env bats
2015-03-07 18:19:15 -05:00
load helpers
2015-02-25 17:41:02 -05:00
@test "cli: show info" {
2015-03-07 18:19:15 -05:00
run machine
2015-02-25 17:41:02 -05:00
[ "$status" -eq 0 ]
[[ ${lines[0]} =~ "NAME:" ]]
[[ ${lines[1]} =~ "Create and manage machines running Docker" ]]
}
@test "cli: show active help" {
2015-03-07 18:19:15 -05:00
run machine active -h
2015-02-25 17:41:02 -05:00
[ "$status" -eq 0 ]
[[ ${lines[3]} =~ "command active" ]]
}
@test "cli: show config help" {
2015-03-07 18:19:15 -05:00
run machine config -h
2015-02-25 17:41:02 -05:00
[ "$status" -eq 0 ]
[[ ${lines[3]} =~ "command config" ]]
}
@test "cli: show inspect help" {
2015-03-07 18:19:15 -05:00
run machine inspect -h
2015-02-25 17:41:02 -05:00
[ "$status" -eq 0 ]
[[ ${lines[3]} =~ "command inspect" ]]
}
@test "cli: show ip help" {
2015-03-07 18:19:15 -05:00
run machine ip -h
2015-02-25 17:41:02 -05:00
[ "$status" -eq 0 ]
[[ ${lines[3]} =~ "command ip" ]]
}
@test "cli: show kill help" {
2015-03-07 18:19:15 -05:00
run machine kill -h
2015-02-25 17:41:02 -05:00
[ "$status" -eq 0 ]
[[ ${lines[3]} =~ "command kill" ]]
}
@test "cli: show ls help" {
2015-03-07 18:19:15 -05:00
run machine ls -h
2015-02-25 17:41:02 -05:00
[ "$status" -eq 0 ]
[[ ${lines[3]} =~ "command ls" ]]
}
@test "cli: show restart help" {
2015-03-07 18:19:15 -05:00
run machine restart -h
2015-02-25 17:41:02 -05:00
[ "$status" -eq 0 ]
[[ ${lines[3]} =~ "command restart" ]]
}
@test "cli: show rm help" {
2015-03-07 18:19:15 -05:00
run machine rm -h
2015-02-25 17:41:02 -05:00
[ "$status" -eq 0 ]
[[ ${lines[3]} =~ "command rm" ]]
}
@test "cli: show env help" {
2015-03-07 18:19:15 -05:00
run machine env -h
2015-02-25 17:41:02 -05:00
[ "$status" -eq 0 ]
[[ ${lines[3]} =~ "command env" ]]
}
@test "cli: show ssh help" {
2015-03-07 18:19:15 -05:00
run machine ssh -h
2015-02-25 17:41:02 -05:00
[ "$status" -eq 0 ]
[[ ${lines[3]} =~ "command ssh" ]]
}
@test "cli: show start help" {
2015-03-07 18:19:15 -05:00
run machine start -h
2015-02-25 17:41:02 -05:00
[ "$status" -eq 0 ]
[[ ${lines[3]} =~ "command start" ]]
}
@test "cli: show stop help" {
2015-03-07 18:19:15 -05:00
run machine stop -h
2015-02-25 17:41:02 -05:00
[ "$status" -eq 0 ]
[[ ${lines[3]} =~ "command stop" ]]
}
@test "cli: show upgrade help" {
2015-03-07 18:19:15 -05:00
run machine upgrade -h
2015-02-25 17:41:02 -05:00
[ "$status" -eq 0 ]
[[ ${lines[3]} =~ "command upgrade" ]]
}
@test "cli: show url help" {
2015-03-07 18:19:15 -05:00
run machine url -h
2015-02-25 17:41:02 -05:00
[ "$status" -eq 0 ]
[[ ${lines[3]} =~ "command url" ]]
}
@test "flag: show version" {
2015-03-07 18:19:15 -05:00
run machine -v
2015-02-25 17:41:02 -05:00
[ "$status" -eq 0 ]
[[ ${lines[0]} =~ "version" ]]
}
@test "flag: show help" {
2015-03-07 18:19:15 -05:00
run machine --help
2015-02-25 17:41:02 -05:00
[ "$status" -eq 0 ]
[[ ${lines[0]} =~ "NAME" ]]
}