-
Notifications
You must be signed in to change notification settings - Fork 102
Add entry via stdin to the init command #426
Add entry via stdin to the init command #426
Conversation
Signed-off-by: Bruna Tavares <silvatavares.bruna@gmail.com>
Signed-off-by: Bruna Tavares <silvatavares.bruna@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #426 +/- ##
=======================================
Coverage 66.31% 66.31%
=======================================
Files 80 80
Lines 2779 2779
=======================================
Hits 1843 1843
Misses 749 749
Partials 187 187 Continue to review full report at Codecov.
|
I think you forgot to put the explanatory texts in the PR |
Yes, I am still developing it, but I will remember to update the description. Thanks (: |
Signed-off-by: Bruna Tavares <silvatavares.bruna@gmail.com>
Signed-off-by: Bruna Tavares <silvatavares.bruna@gmail.com>
return func(cmd *cobra.Command, args []string) error { | ||
init := initStdin{} | ||
|
||
err := stdin.ReadJson(cmd.InOrStdin(), &init) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cmd.InOrStdin() returns os.Stdin() by default, so it continues with the normal behavior for use in production and we were able to mock it for testing.
} | ||
} | ||
|
||
func Test_initCmd_runAnyEntry(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did stdin's tests with cmd's, so we can cover the situations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥇
Signed-off-by: Bruna Tavares <silvatavares.bruna@gmail.com>
…add-entry-via-stdin-to-the-init-command Signed-off-by: Bruna Tavares <silvatavares.bruna@gmail.com>
2792307
/merge qa |
👌 Merged branch feature/add-entry-via-stdin-to-the-init-command into qa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job!
- What I did
Add entry via stdin to the init command. - Also includes stdin tests for init - Updates tests from the init_test.go file to include stdin tests.
- How to verify it
Clone this pr with the command and build Ritchie
git fetch upstream pull/426/head:feature/add-entry-via-stdin-to-the-init-command git checkout feature/add-entry-via-stdin-to-the-init-command make build && sudo cp dist/linux/rit /usr/local/bin/
Run tests
- Description for the changelog
Add entry via stdin to the init command.