Files
cleveragents-core/features/project_cli_switch.feature
T

43 lines
2.0 KiB
Gherkin

Feature: Project CLI switch command
As a developer
I want to switch between registered projects
So that I can manage my active project without changing directories
Background:
Given a project CLI commands test database is initialized
# ── switch command ─────────────────────────────────────────────
Scenario: switch command with rich output sets active project
Given a project "local/switch-proj" is created in the commands DB
When I invoke project-switch for "local/switch-proj" with yes default format
Then the project cmd output should contain "Active Project Switched"
And the project cmd output should contain "switch-proj"
And the project cmd should succeed
Scenario: switch command with json format
Given a project "local/switch-json" is created in the commands DB
When I invoke project-switch for "local/switch-json" with yes format "json"
Then the project cmd output should contain "active"
And the project cmd JSON data should include "previous" key
Scenario: switch to nonexistent project fails
When I invoke project-switch for "local/ghost-proj" with yes default format
Then the project cmd should fail
Scenario: switch command with yaml format
Given a project "local/switch-yaml" is created in the commands DB
When I invoke project-switch for "local/switch-yaml" with yes format "yaml"
Then the project cmd should succeed
Scenario: switch accepts --yes to skip confirmation
Given a project "local/switch-yes" is created in the commands DB
When I invoke project-switch for "local/switch-yes" with yes and short flag
Then the project cmd output should contain "Active Project Switched"
And the project cmd should succeed
Scenario: show command can be interrupted by user confirmation denial
Given a project "local/switch-cancel" is created in the commands DB
When I invoke project-switch for "local/switch-cancel" without yes
Then the project cmd should fail