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

Methods in Melomel::Cucumber only with '!' #14

Open
scho opened this issue Aug 19, 2011 · 2 comments
Open

Methods in Melomel::Cucumber only with '!' #14

scho opened this issue Aug 19, 2011 · 2 comments
Labels

Comments

@scho
Copy link
Contributor

scho commented Aug 19, 2011

Hi,
I was playing around with the different finder methods in Melomel and I ran into the following issue:

There a methods in Melomel::Bride and Melomel::Cucumber.

But only the methods in Melomel::Bride have an exclamation mark (e.g. find_all!) implementation and an implementation without an exclamation mark (e.g. find_all). So you can't use any methods in Melomel::Cucumber without throwing an error, if Melomel can't find an object.

So I would prefer, when you run your features, that you get:
expected: not nil got: nil (RSpec::Expectations::ExpectationNotMetError)
instead of:
No object found (Melomel::MelomelError)

What do you think about it? Wouldn't that be nice? ;)

@benbjohnson
Copy link
Owner

I think I see what you're saying. Just return nil and let RSpec do the validation? There was some talk about removing the "!" methods. It does seem like the right way to do it. I'm not sure that I have time right now. If you want to fork the code and have it return nils then I'll merge it in as a v0.7.x release.

@scho
Copy link
Contributor Author

scho commented Aug 19, 2011

You're right, that was my point, lets do RSpec do the validation, at least when you check for existance of an object. I try to find some time next week to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants