velesin/jasmine-jquery — pull request #87 by MaxShishkin (2012-08-16 20:53:42+00:00)
Title: Add support for loading style fixtures

Hi! I was writing tests for a jQuery plugin recently and some of the tests relied on css. I need a position: absolute rule to be applied to some div's in order to test left and right properties.

I didn't want to add styles directly to the SpecRunner.html itself and wanted to kind of tie them up to the fixtures i was testing. I tried to add the style tag wight an @import rule directly to the fixture html file, but that worked half of the time. Sometimes tests passed, sometimes not and i got a NaN while trying to test left or right properties against a real number. I think that was because css rules sometimes didn't apply just in time.

So, i managed to write an addon to be able to load style fixtures directly in tests and it seems to solve my problem. I added preload, load and set methods for style fixtures. Please, check if you could incorporate this into you library, may be it would be useful for someone else.