Skip to content

Commit

Permalink
updating tests to use command
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalghost-dev committed Aug 28, 2024
1 parent 7b28c25 commit 9a51101
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,42 @@ func TestCLI(t *testing.T) {
expectedExit int
}{
{
args: []string{},
expectedOutput: "Please declare a Pokémon's name after the CLI name\nRun 'poke-cli --help' for more details\nerror: insufficient arguments\n",
args: []string{"pokemon"},
expectedOutput: "Please declare a Pokémon's name after [pokemon] command\nRun 'poke-cli --help' for more details\nerror: insufficient arguments\n",
expectedExit: 1,
},
{
args: []string{"bulbasaur"},
args: []string{"pokemon", "bulbasaur"},
expectedOutput: "Your selected Pokémon: Bulbasaur\nNational Pokédex #: 1\n",
expectedExit: 0,
},
{
args: []string{"mew", "--types"},
args: []string{"pokemon", "mew", "--types"},
expectedOutput: "Your selected Pokémon: Mew\nNational Pokédex #: 151\n──────\nTyping\nType 1: psychic\n",
expectedExit: 0,
},
{
args: []string{"cacturne", "--types"},
args: []string{"pokemon", "cacturne", "--types"},
expectedOutput: "Your selected Pokémon: Cacturne\nNational Pokédex #: 332\n──────\nTyping\nType 1: grass\nType 2: dark\n",
expectedExit: 0,
},
{
args: []string{"chimchar", "types"},
args: []string{"pokemon", "chimchar", "types"},
expectedOutput: "Error: Invalid argument 'types'. Only flags are allowed after declaring a Pokémon's name\n",
expectedExit: 1,
},
{
args: []string{"flutter-mane", "types"},
args: []string{"pokemon", "flutter-mane", "types"},
expectedOutput: "Error: Invalid argument 'types'. Only flags are allowed after declaring a Pokémon's name\n",
expectedExit: 1,
},
{
args: []string{"AmPhaROs", "--types", "--abilities"},
args: []string{"pokemon", "AmPhaROs", "--types", "--abilities"},
expectedOutput: "Your selected Pokémon: Ampharos\nNational Pokédex #: 181\n──────\nTyping\nType 1: electric\n─────────\nAbilities\nAbility 1: static\nHidden Ability: plus\n",
expectedExit: 0,
},
{
args: []string{"CLOysTeR", "-t", "-a"},
args: []string{"pokemon", "CLOysTeR", "-t", "-a"},
expectedOutput: "Your selected Pokémon: Cloyster\nNational Pokédex #: 91\n──────\nTyping\nType 1: water\nType 2: ice\n─────────\nAbilities\nAbility 1: shell-armor\nAbility 2: skill-link\nHidden Ability: overcoat\n",
expectedExit: 0,
},
Expand Down

0 comments on commit 9a51101

Please sign in to comment.