Skip to content

Commit

Permalink
(#65) Add tests for the tags command
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelapenya committed Feb 14, 2019
1 parent 6f9efbf commit 71e9e7d
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ env:
- LPN_COMMAND=rmi
- LPN_COMMAND=run
- LPN_COMMAND=stop
- LPN_COMMAND=tags
- LPN_COMMAND=version

before_install:
Expand All @@ -30,7 +31,7 @@ before_install:

install:
- |
if [ "$LPN_COMMAND" != "license" ] && [ "$LPN_COMMAND" != "version" ]; then
if [ "$LPN_COMMAND" != "license" ] && [ "$LPN_COMMAND" != "tags" ] && [ "$LPN_COMMAND" != "version" ]; then
./scripts/pull-images.sh
fi
- go build
Expand Down
67 changes: 67 additions & 0 deletions features/tags.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
Feature: Tags command
As a newcomer to lpn
I want to be able to list the available tags for an image type

Scenario Outline: List available tags without pagination
When I run `lpn tags <type>`
Then the output should contain:
"""
elements in page 1 of
"""
And the exit status should be 0

Examples:
| type |
| ce |
| commerce |
| dxp |
| nightly |
| release |

Scenario Outline: List available tags with pagination
When I run `lpn tags <type> -p 2 -s 2`
Then the output should contain:
"""
elements in page 2 of
"""
And the exit status should be 0

Examples:
| type |
| ce |
| commerce |
| dxp |
| nightly |
| release |

Scenario Outline: List available tags with size
When I run `lpn tags <type> -s 2`
Then the output should contain:
"""
showing 2 elements in page 1 of
"""
And the exit status should be 0

Examples:
| type |
| ce |
| commerce |
| dxp |
| nightly |
| release |

Scenario Outline: Inform that the combination of page and size produces a not found resource error
When I run `lpn tags <type> -p 103`
Then the output should contain:
"""
There are no available tags for that pagination. Please use --page and --size arguments to filter properly
"""
And the exit status should be 0

Examples:
| type |
| ce |
| commerce |
| dxp |
| nightly |
| release |

0 comments on commit 71e9e7d

Please sign in to comment.