 
         describe "when calling clear", ->
             beforeEach ->
+                @publishReady = sinon.stub()
+                service.on("ready", @publishReady)
                 service.set("testkey1", 1)
                 service.set("testkey2", 2)
                 service.set("testkey3", 3)
                 service.clear()
 
+            afterEach ->
+                service.off("ready", @publishReady)
+
             it "should call storageProvider.getItem for the index", ->
                 spyCall = @getMetadata.getCall(0)
                 spyCall.args[0].should.equal("testns#index:primary")

            it "should result in an empty array for keys", ->
                @keys = service.keys
                @keys.length.should.equal(0)


    describe "with one item of pre-loaded data", ->

            ).should.throw(StoreitError)

        describe "then once we call load()", ->
            beforeEach ->
                @publishReady = sinon.stub()
                service.on("ready", @publishReady)
                service.load()

            afterEach ->
                service.off("ready", @publishReady)

            it "should have `isInitialized` set to true", ->
                service.isInitialized.should.equal(true)
            it "should publish a 'ready' event", ->
                @publishReady.should.have.been.called

        describe "then once we call clear()", ->
            beforeEach ->
                @publishReady = sinon.stub()
                service.on("ready", @publishReady)
                service.clear()

            afterEach ->
                service.off("ready", @publishReady)

            it "should have `isInitialized` set to true", ->
                service.isInitialized.should.equal(true)
            it "should publish a 'ready' event", ->
                @publishReady.should.have.been.called
