Skip to content

Commit

Permalink
refactor: scenario generarion + improve UX
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Oct 23, 2022
1 parent b3f0adf commit 5c41512
Show file tree
Hide file tree
Showing 10 changed files with 307 additions and 234 deletions.
2 changes: 0 additions & 2 deletions assist/spec.md

This file was deleted.

14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"license": "MIT",
"dependencies": {
"@herbsjs/herbs2repl": "^1.0.5",
"ansi-256-colors": "^1.1.0",
"git-user-name": "^2.0.0",
"glob": "^8.0.3",
"gluegun": "^5.1.2",
Expand Down
505 changes: 281 additions & 224 deletions src/commands/assist.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Group: Project
Usecase: Create Project

~~~~
Scenario: A project should be created if the project is valid
Given a valid project
When the project is created
Expand All @@ -12,8 +13,9 @@ Then the project is not created on the repository
~~~~
END

Group: Reservation
Usecase: Update Reservation

~~~~
Scenario: A reservation should be updated if the reservation is valid
Given a valid reservation
When the reservation is updated
Expand All @@ -36,8 +38,9 @@ Then the reservation is not updated on the repository
~~~~
END

Group: Payment
Usecase: Change Payment Status

~~~~
Scenario: Payment status can be changed if payment is not paid
Given a payment with status not paid
When the payment status is changed
Expand All @@ -55,4 +58,5 @@ Then the payment status is not changed on the repository
~~~~
END

Group: <%- props.usecaseGroup %>
Usecase: <%- props.usecaseName %>
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Usecase: <%- props.usecaseName %>
<%- props.spec %>
<%- props.scenarios %>
1 change: 0 additions & 1 deletion src/templates/assist/spec.codex.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ module.exports =
~~~~
END

Usecase: <%- props.usecaseName %>
<%- props.scenarios %>

Output:
2 changes: 1 addition & 1 deletion src/templates/assist/spec.ejs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<%- props.code %>
<%- props.spec %>
2 changes: 1 addition & 1 deletion src/templates/assist/usecase.codex.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ END
Example: `<%- props.usecaseName %>`
Input:
~~~~
<%- props.specCode %>
<%- props.spec %>
~~~~

Output:
2 changes: 1 addition & 1 deletion src/templates/assist/usecase.ejs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<%- props.code %>
<%- props.usecase %>

0 comments on commit 5c41512

Please sign in to comment.