-
Notifications
You must be signed in to change notification settings - Fork 256
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
trying and failing :-( #173
Comments
Hi, |
this is actually not true. You can have a test in the same directory "mystuff" but in a different package "mystuff_test". But as the feature file is in features/mystuff.feature, I think godoc looks only in that directory for corresponding test files. Perhaps I should write a test file inside the features directory with "features_test" as the package, calling the functions to test from "mystuff". But I can guess, but I think that others have done this before me, since I'm not the first to try godog. |
godog looks only in the current directory you run from. If go supports looking for test files in packages suffixed by |
so I go inside the mystuff directory whenre I put the mystuff.feature and the mystuff_test.go file? So I can do the first now :-) I have this: |
I tried ""./mystuff" and ""./mystuff/" and "/mystuff/" and "mystuff/" and "/mystuff" and just "mystuff" |
when I do "." I get a stack trace so maybe I'm on the right path. |
in most of the cases godog is used for functional tests and it is run from a single package, which contains all the public user facing interface. given it is an API, in that case you would have a main package, which starts a http server or in other case if it is a command line tool, a cmd subdirectory with a main package to build that command line interface binary. The test files, features and contexts are placed in that main package. just look into examples and godog library itself. or for example minishift |
So I have a feature file inside the features folder., and I have a test file inside some package folder "mystuff". Inside it there a file called "Abbreviate.go". How can I tell godog to use the Abbreviate_test.go in the same "mystuff" folder (but it has the package "mystuff_test")
I've looked for more info, but I find it unclear from documentation where files should be and what they should contain.
I tried with the testmain option, but it starts complaining about missing colors and other stuff
:-(
Let's just start with some basic example where people have subdirectories: where can I find such example?
The text was updated successfully, but these errors were encountered: