     else
       throw "You must call #enableExpectations on your instance of Brainstem.StorageManager before you can set expectations."
 
-  stubImmediate: (collectionName, options) =>
+  stubImmediate: (collectionName, options) ->
     @stub collectionName, $.extend({}, options, immediate: true)
 
-  enableExpectations: =>
+  enableExpectations: ->
     @expectations = []
 
-  handleExpectations: (loader) =>
+  handleExpectations: (loader) ->
     name = loader.getCollectionName()
 
     for expectation in @expectations


  # Access the cache for a particular collection.
  #    manager.storage("time_entries").get(12).get("title")
  storage: (name) =>
    @getCollectionDetails(name).storage

  dataUsage: =>
    sum = 0
    for dataType in @collectionNames()
      sum += @storage(dataType).length
    sum

  reset: =>
    for name, attributes of @collections
      attributes.storage.reset []
      attributes.cache = {}

  # Access details of a collection.  An error will be thrown if the collection cannot be found.
  getCollectionDetails: (name) =>
    @collections[name] || @collectionError(name)

  collectionNames: =>
    _.keys(@collections)

  collectionExists: (name) =>
    !!@collections[name]

  setErrorInterceptor: (interceptor) =>
    @errorInterceptor = interceptor || (handler, modelOrCollection, options, jqXHR, requestParams) -> handler?(jqXHR)

  loadModel: (name, id, options = {}) =>
    return if not id

    successCallback = options.success

    ml.done(successCallback) if successCallback? && _.isFunction(successCallback)
    ml.externalObject

  loadCollection: (name, options = {}) ->
    successCallback = options.success
    options = _.omit(options, 'success')

