Hidden Require Dependency

require'spec_helper'require'logger'require'stringio'describe'Running the server locally'doit'logs that it is running'doio=StringIO.newallow(Logger).toreceive(:new).and_return(Logger.newio)expect{load'script/local-server'}.tochange{io.string}.toinclude'SERVER: starting up'endend

However, when the script is run standalone, it errors with:

1

uninitializedconstantLogger(NameError)

Be aware that since load
happens in the current spec context, a missing require may not be noticed if
it is required by the spec.

Whenever possible have at least one test that shells out as a sanity check.