 
     register_fn = -> Registry.registerModule shellModule
 
-    # helper functions
     assertObjectSize = (object, size) => expect(_.keys(object).length).toBe size
     unregisterAllShells = => Registry.modules = {}
+
+    # -- setup and teardown --
+
+    beforeEach -> modulesClone = _.clone Registry.modules
+    afterEach -> Registry.modules = modulesClone
+
+    # -- test cases --
 
     it 'should be a function', ->
       expect(_.isFunction Registry.registerModule).toBe true

          assertObjectSize Registry.modules, 0

      it 'should throw error if properties are of incorrect types', ->
        stringProperties = [ 'id', 'title', ]
        _.each stringProperties, (property) ->
          moduleClone = _.clone shellModule


          # unregister all shells
          unregisterAllShells()

