I just spent time trying to understand why my specifications went in isolation, but when testing the controller and the library together, some specifications were mysteriously unsuccessful. The culprit was the following:
In one spec:
describe SomeThing do
CONSTANT_VALUE = "a value"
end
And in another:
describe AnotherThing do
CONSTANT_VALUE = "a different value"
end
The values assigned to these constants flowed between my specifications and caused unexpected behavior. Should I use a block letto define constants, etc.? Or something else?
source
share