Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor test script #78

Merged
merged 4 commits into from
Apr 29, 2021
Merged

Refactor test script #78

merged 4 commits into from
Apr 29, 2021

Conversation

rokshana-b
Copy link
Contributor

Changed the test script to make code more reusable

@rokshana-b rokshana-b requested a review from iahmad9 April 24, 2021 20:58

BeforeEach(func() {

Context("Given I have a wego binary installed on my local machine", func() {
Expect(FileExists(WEGO_BIN_PATH)).To(BeTrue())
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Context container is not recommended to be used in BeforeEach or It blocks, instead it is preferred to keep them outside. Any particular reason for using it in this way?

Copy link
Contributor Author

@rokshana-b rokshana-b Apr 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was the only way I could make the script run... I wanted to run the Given condition before each test case but the hierarchy of Describe, Context, It, & By was giving me problems.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed Context to By — seems to work just fine.

var _ = Describe("WEGO Acceptance Tests", func() {

var session *gexec.Session
var err error
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good one 👍


It("Verify that wego flux can print out version information", func() {

By("When I run 'wego flux -- -version", func() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be good if this is changed to wego flux -- -v as that's what the test case is testing.

@rokshana-b rokshana-b merged commit 9c625e8 into main Apr 29, 2021
@rokshana-b rokshana-b deleted the add-wego-test-case branch April 29, 2021 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants