File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 11dockerll () {
2- docker ps -a --format " table {{ .Names }}\t{{ .Status }}\t{{ .Networks }}\t{{ .Ports }}"
2+ docker ps -a --format " table {{ .Names }}\t{{ .Status }}\t{{ .Networks }}\t{{ .Ports }}" $@
33}
Original file line number Diff line number Diff line change @@ -8,6 +8,21 @@ function set_up() {
88test_dockerll () {
99 local output=$( dockerll)
1010
11+ assert_greater_or_equal_than 2 " $( echo " $output " | wc -l) "
12+
13+ # output header
14+ local first_line=$( echo " $output " | head -n 1)
15+ assert_contains " NAMES " " $first_line "
16+ assert_contains " STATUS " " $first_line "
17+ assert_contains " NETWORKS " " $first_line "
18+ assert_contains " PORTS" " $first_line "
19+ }
20+
21+ test_dockerll_filtered_by_name () {
22+ local output=$( dockerll --filter name=shell-dev-tools)
23+
24+ assert_line_count 2 " $output "
25+
1126 # output header
1227 local first_line=$( echo " $output " | head -n 1)
1328 assert_contains " NAMES " " $first_line "
@@ -16,7 +31,7 @@ test_dockerll() {
1631 assert_contains " PORTS" " $first_line "
1732
1833 # output shell-dev-tools container
19- local second_line=$( echo " $output " | sed -n ' 2p' ) # @TODO: what if it's not the 2. line?
34+ local second_line=$( echo " $output " | sed -n ' 2p' )
2035 assert_contains " shell-dev-tools " " $second_line "
2136 assert_matches " Up [0-9]+ (seconds|minutes) " " $second_line "
2237 assert_contains " shell-dev-tools_default" " $second_line "
You can’t perform that action at this time.
0 commit comments