bitprophet/spec — Issue #1: Play nice with Rudolf
Author: bitprophet
Created: 2011-10-31 06:59:46+00:00
State: open

Running `--with-spec` and `--with-color` simultaneously causes Rudolf to blow up, as its `setOutputStream` is never called, thus its `_formatter` is never defined.

This is because `spec` takes over the output stream when it runs, by returning a value from its `setOutputStream` implementation, and it is ending up first in the plugin list (relatively arbitrarily, as far as I can tell.)

----

`rudolf` does not do this override of the output stream, ostensibly meaning it can do its thing without requiring absolute control over the output (I'm not 100% sure of this myself, but have no specific reason to doubt it either.)

This implies one solution is just to get Rudolf loading before Spec.

It's not immediately clear how best to do this (just juggling the plugins' flags in `nose.core.run(argv)` doesn't seem to work; and adding them to `run(addplugins)` doesn't help either because they're autoloaded elsewhere, and require the flags to operate anyways.

But keep poking -- there should certainly be a way to fully override the loaded plugins, even if it means manually pulling in all the core stuff by hand. (Hopefully just for testing...if that makes everything Just Work, then it will be time to find a non-shitty way of doing this load order crap.)

----

The other, possibly harder but possibly "better" approach, would be to integrate Rudolf into Spec, so that the plugins are not fighting with each other.

Pluses: better control over how the two features interact; gives folks who want both (which I'd guess is almost anybody interested in Spec to begin with), both features without needing 2x the dependencies.

Minuses: could be a moderate amount of work; conflates things for anybody who wants one feature without the other, or anytime somebody wants to tweak/change the behavior of one but not the other (the general "putting unrelated things into one bucket" problem.)