ftlabs / fruitmachine-media

FruitMachine helper that allows different setup and teardown callbacks to be called based on media queries
MIT License
6 stars 3 forks source link

Sort queue better, process queue in a serial fashion. #12

Closed AdaRoseCannon closed 10 years ago

AdaRoseCannon commented 10 years ago

Queue is now sorted in a Teardown, Setup, Teardown, Setup, Teardown, Setup order, performed in the order the pairs were added.

Each step is performed sequentially.

There are now buster tests to test this behaviour.

rowanbeentje commented 10 years ago

Looks good - tests all pass now without any exceptions :)

I'm a little confused by the addPair() logic. Is that so that a teardown+setup group is always paired across multiple modules? (Should this be tested by the Apple and Orange test setup? All the setup seems to be there but am I missing the assertions across modules?) What happens if there are two modules in one state and one module in another?

AdaRoseCannon commented 10 years ago

No the teardown is setup is paired inside a single module. There is no intermodule communication. I.e. For every setup after the first there can be a preceding teardown which needs to happen. This ensures that this teardown happens before the setup starts and that the next thing to happen is the next setup.

rowanbeentje commented 10 years ago

:cake: :shipit: