-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
#with and stubbing #123
Comments
Oh, thanks for filing my issue for me, Space. |
Yours?! He found it! Well, after I told him about it. But I'd have never filed a report. |
Oh, so he found it and then waited til I independently found it before filing an issue. And he cited my gist, just for the hell of it. Right. |
@BrokenLadder I owe you a great apology for my behaviour. As such, @rubypanther found the answer. You need to mock the method. Oh no, I found it after you left, but Mr.Panther found the actual issue you were having. I delved through the rspec source to locate the missing feature, so to speak. I'm working on a pull request for automagic stubbing. |
Apology accepted. But what do you mean I need to mock the method. I know how to make the spec work. My complaint is that, this bug causes RSpec to give an unhelpful/incorrect message when I don't set the spec up properly. |
Right, it was definitely a rather ridiculous communication breakdown on my part. I want to see what the ruling is on the issue, and then finish this up and pull request. Whether that means just adjusting the exception message, or add full automagic stubbing when using #with. |
And now back to the task at hand: It would seem here that when you use the |
/me hugs it out with Spaceghost |
@radar Yeah, with Apeiros' and @rubypanther's help to find the original source file for the issue, we got it tacked down to that. What @rubypanther suggested was to handle methods that need a stub by checking if the method is stubbed and then creating a stub for it if it doesn't exist. That way it doesn't break API, and maybe it could move forward to not require the stub at all. |
Thanks for reporting, gents. |
@justinko - I can get a pull request in to do the above. |
Great, please do! |
…ethod with default behavior.
Issue #123: Improved error message when user forgets to stub a method with a default.
This appears to have been addressed with #147. Closing, but if I'm wrong, feel free to reopen :) |
Why do you need to implicitly stub the tested method when using #with?
This fails and is documented, but I'd like to understand if this is a feature or a currently unaddressed issue. If it's intentional, is there a way to make it more obvious that it's because the method wasn't stubbed?
https://gist.github.com/2274040
As an aside, the issue number is 123 which leads me to believe that this feature is elementary.
I'm in the middle of trudging along through the internals and coming up with some options. Sorry for the terrible humor, it's April Fools' day. Not that this is a troll.
The text was updated successfully, but these errors were encountered: