Eh scratch all that. I walked through the steps and figured out what was happening. Since I was setting the rotation using the vanilla setStyle method, the getRotation method was getting out of sync. Specifically, the first getRotation call reads the style value (0deg) but the second one reads the cached value (0) using set/retrieve instead of re-parsing the style property.
I don't think I would've caught this without JSSpec, pretty nifty. On Nov 29, 3:44 pm, Aaron Newton <[email protected]> wrote: > doesn't the effect have a duration? if so, it's rotating it over a duration > while your assertion is happening immediately. You can't really test things > like Fx w/ Specs - anything that is asynchronous. > > > > On Sat, Nov 28, 2009 at 11:55 PM, pradador <[email protected]> wrote: > > I'm trying to learn how to use JSSpec and I'm having issues with this > > test. I can't figure out why on earth it fails and I thought maybe one > > of the MooTools people can share some insight. Here's the relevant > > code: > > >http://gist.github.com/244835 > > > I can't understand why it says the test on line 9 states (should be: > > -90.1) when it really says should_be(0). If I add another "el = new > > Element('div')" in between the tests, the problem goes away. Any > > thoughts?
