-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add InvalidStepDefinition error #79
Add InvalidStepDefinition error #79
Conversation
Resolves #78. InvalidStepDefinitionError is raised if step definition does not respond to `#call`. It covers both missing definitions and improper definitions (i.e. strings). Also, OperationResolver used `&&` to chain operations, which lead to presence of `false` in the result. Got rid of it. Now it's either object from the container, or a nil.
Thank you so much for this. ❤️ What about using MissingStepDefinition instead of InvalidStepDefinition I think bring more value to the actual exception |
That is actually what I did, initially. I removed it, however. Thought that just checking for However, there's still a question to answer: What should be the superclass of the exception? Should it be I'm thinking |
Ah, yes, if we wish to stay with both MissingStepDefinition and InvalidStepDefinition (I hope we do), we'll have to do some tricky magic. The simplest way to tell if the definition is missing is to call I'm going to look for a way around this. |
Sorry for the delay. Finally managed to find time to finish this. Apparently, I was silly enough to misunderstand the semantics of assignments inside Ruby class definitions, which held me off for too long. So, presently, this PR adds two kinds of exceptions:
|
@Morozzzko Thank you so much for your work |
Hi folks, I should be able to look at this tomorrow :) |
@Morozzzko This is great stuff, and will definitely help people debug step problems more easily. Thank you! If you don't mind, I have a couple of minor naming requests: do you think you could rename these to Thanks! |
Thank you for the review! The new names are great -- renamed & pushed. |
Resolves #78.
InvalidStepDefinitionError is raised if step definition does not respond
to
#call
. It covers both missing definitions and improper definitions(i.e. strings).
Also, OperationResolver used
&&
to chain operations, which lead topresence of
false
in the result. Got rid of it. Now it's eitherobject from the container, or a nil.