chad/turbulence — pull request #27 by geeksam (2014-03-05 19:59:24+00:00)
Title: Turns out class attribute accessors are a great way to leak state between tests

There are still a couple of spec that fail intermittently when run in random order. This happens because some tests set ```Turbulence::Calculators::Churn.scm```—which does not appear to have a default. In normal use, the CLI class will set this, but some of the specs bypass this.

The root cause, though, is that Turbulence::Calculators::Churn is effectively a Singleton object, although it doesn't actually use the Ruby mixin of that name.

I wanted a little refactoring exercise, so I started extracting a config object to hold everything that the CLI class is using OptionParser to read. So far, I've pushed that change out as far as Turbulence::Calculators::Churn while still preserving its current interface.

Technically, this PR could be merged as is, but I think the next step is to change collaborators of the Turbulence::Calculators::Churn so that they talk to an instance of the class (into which a config object can be injected) rather than the class itself. This seemed like a good time to ask for comments, since I'm stopping for lunch... :)