-
Notifications
You must be signed in to change notification settings - Fork 153
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
Conversation
|
||
BeforeEach(func() { | ||
|
||
Context("Given I have a wego binary installed on my local machine", func() { | ||
Expect(FileExists(WEGO_BIN_PATH)).To(BeTrue()) | ||
}) |
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 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?
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.
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.
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've changed Context
to By
— seems to work just fine.
var _ = Describe("WEGO Acceptance Tests", func() { | ||
|
||
var session *gexec.Session | ||
var err error |
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 one 👍
test/acceptance/test/smoke_tests.go
Outdated
|
||
It("Verify that wego flux can print out version information", func() { | ||
|
||
By("When I run 'wego flux -- -version", func() { |
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.
would be good if this is changed to wego flux -- -v
as that's what the test case is testing.
Changed the test script to make code more reusable