-
Notifications
You must be signed in to change notification settings - Fork 27
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
Strange error when creating strict mock #49
Comments
Pretty sure I fixed that, I'll have to check which version was affected. cheers, On Thu, Nov 10, 2011 at 3:13 PM, Hob spillane <
|
I grabbed the latest code & compiled from source and this issue seems to be gone. I'm seeing something else strange though. It seems like anywhere where we were doing assignments inside of expect()s, we're now getting errors thrown. For example:
That expect() now throws an exception where it did not before. The code never even gets to the replay() call. |
And it's back. Sort of... Now I'm getting the error only on some runs, and the stack trace is slightly different. Note the 1st line now has a little more verbage. Error: InstanceRecipeBuilder.withClassRecipe |
Found one commonality. In each of the cases that fails, the strict or nice mock is getting created in setup():
|
I need to update the docs, record() and replay() are deprecated as they are
What error is the expect() throwing? Are you using Flash Builder? That stack trace looks like its truncated the Any chance you could share a minimal project that exhibits this issue? cheers On Fri, Nov 11, 2011 at 6:34 AM, Hob spillane <
|
Attaching a simple project. This exhibits the error throwing from expect(), even after I've removed record() & replay(). Still working on getting the other issue to show up in a stand-alone project. Not sure if it'll be possible, but if you'd like we can setup a screenshare so you can see my test suite running. I've got your source linked in, so you should be able to step thru in my environment. -Hob On Nov 10, 2011, at 5:21 PM, Drew Bourne wrote:
|
The tests for using an Invocation to define an Expectation (like: In the case of Then implementation of |
I haven't read extensively through your code, but that's why I thought you needed record() & replay()... So that you could tell the difference between an expectation and an invocation. Could you not also just trap MockolateErrors in expect since you know that you're creating an expectation. Anyway. Not a big deal. For now I've just re-written those expectations using mock(). My bigger concern is the other error (Error: InstanceRecipeBuilder.withClassRecipe). I haven't been able to get that working in a stand-alone project yet. My flashlog is a bit of a mystery... All it's showing is: Warning: 'flash' has no property 'prototype' |
I'd love to trap the error except its not a block thats being passed to expect() it is the result of the invocation. I use heuristics in the proxy to take a best guess at what should happen. Expanding this example into execution order:
Becomes:
As long as people keep it simple there is no need for record() or replay(). For complicated cases I am considering adding something like an
For the other error is it when you run the test case by itself or as part of the suite? |
Its only as part of the suite, and only sometimes. Definitely seems to happen more as I go. As if the fewer resources flash has, the more likely the error is to crop up. |
I switched to Rules instead of prepare() and the test suite seems to be running great. I'll leave this open so you have a place to track deferring the exception to validation phase? |
Just upgraded to 0.12.2. I'm getting an odd error on just a couple of our existing test cases. We're preparing the mocks for this particular strict the same way we are with others. Haven't been able to find anything that makes this case unique yet.
Error
at mockolate.ingredients::InstanceRecipeBuilder/withClassRecipe(InstanceRecipeBuilder.as:21)
at mockolate.ingredients::Mockolatier/strict(Mockolatier.as:172)
at global/mockolate::strict(strict.as:28)
at com.workday.ui.flex.view.controls.workFeedClasses::WorkFeedFilterMenuPresenterTest/setup(WorkFeedFilterMenuPresenterTest.as:54)
at Function/http://adobe.com/AS3/2006/builtin::apply
at flex.lang.reflect::Method/apply(Method.as:244)
at org.flexunit.runners.model::FrameworkMethod/invokeExplosively(FrameworkMethod.as:201)
at org.flexunit.internals.runners.statements::InvokeMethod/evaluate(InvokeMethod.as:72)
at org.flexunit.internals.runners.statements::SequencerWithDecoration/executeStep(SequencerWithDecoration.as:100)
at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete(StatementSequencer.as:141)
at org.flexunit.token::AsyncTestToken/sendResult(AsyncTestToken.as:107)
at org.flexunit.internals.runners.statements::ExpectAsync/sendComplete(ExpectAsync.as:560)
at org.flexunit.internals.runners.statements::ExpectAsync/handleAsyncEventFired(ExpectAsync.as:431)
at flash.events::EventDispatcher/dispatchEventFunction
at flash.events::EventDispatcher/dispatchEvent
at org.flexunit.async::AsyncHandler/handleEvent(AsyncHandler.as:156)
at flash.events::EventDispatcher/dispatchEventFunction
at flash.events::EventDispatcher/dispatchEvent
at Function/http://adobe.com/AS3/2006/builtin::apply
at SetIntervalTimer/onTimer
at flash.utils::Timer/_timerDispatch
at flash.utils::Timer/tick
The text was updated successfully, but these errors were encountered: