 import Clappr
 
 class BaseObjectTests: QuickSpec {
-    private let eventName = "some-event"
     
     override func spec() {
         describe("BaseObject") {
             
             var baseObject: BaseObject!
             var callbackWasCalled: Bool!
+            
+            let eventName = "some-event"
+            let callback: EventCallback = { userInfo in
+                callbackWasCalled = true
+            }
             
             beforeEach {
                 baseObject = BaseObject()

                it("Should fire callback for an event on a given context object") {
                    let contextObject = BaseObject()
                    
                    baseObject.listenTo(contextObject, eventName: self.eventName) { userInfo in
                        callbackWasCalled = true
                    }
                    
                    baseObject.trigger(self.eventName)
                    
                    expect(callbackWasCalled) == true
                }

            
            describe("on") {
                it("Callback should be called on event trigger") {
                    baseObject.on(eventName, callback: callback)
                    baseObject.trigger(eventName)
                    
                    expect(callbackWasCalled) == true
                }
                
                it("Callback should receive userInfo on trigger with params") {
                    var value = "Not Expected"
                    baseObject.on(eventName) { userInfo in
                        value = userInfo?["new_value"] as! String
                    }
                    
                    baseObject.trigger(eventName, userInfo: ["new_value": "Expected"])
                    
                    expect(value) == "Expected"
                    
                }
                
                it("Callback should be called for every callback registered") {
                    baseObject.on(eventName, callback: callback)
                    
                    var secondCallbackWasCalled = false
                    baseObject.on(eventName) { userInfo in
                        secondCallbackWasCalled = true
                    }
                    
                    baseObject.trigger(eventName)
                    
                    expect(callbackWasCalled) == true
                    expect(secondCallbackWasCalled) == true
                }
                
                it("Callback should not be called for another event trigger") {
                    baseObject.on(eventName, callback: callback)
                    
                    baseObject.trigger("another-event")
                    
