                     context("and has position less than 100") {
                         
                         it("triggers enable dvr with false") {
-                            let core = buildCore(position: 10, playbackType: .live)
+                            let plugin = buildPlugin(position: 10, playbackType: .live)
                             var didHaveDvr = true
-                            core.activePlayback?.on("enableDVR") { (userInfo: EventUserInfo) in
+                            plugin.core?.activePlayback?.on("enableDVR") { (userInfo: EventUserInfo) in
                                 didHaveDvr = (userInfo?["enabled"] as? Bool) ?? false
                             }
                             
-                            core.trigger(InternalEvent.didChangeActiveContainer.rawValue)
+                            plugin.core?.trigger(InternalEvent.didChangeActiveContainer.rawValue)
                             
                             expect(didHaveDvr).toEventually(beFalse())
                         }

                    
                    context("and has position less than 100") {
                        it("triggers enable dvr with false") {
                            let core = buildCore(position: 10, playbackType: .live)
                            var didHaveDvr = true
                            core.activePlayback?.on("enableDVR") { (userInfo: EventUserInfo) in
                                didHaveDvr = (userInfo?["enabled"] as? Bool) ?? false
                            }
                            
                            core.activePlayback!.trigger(Event.bufferUpdate.rawValue)
                            
                            expect(didHaveDvr).toEventually(beFalse())
                        }

                
                context("and core triggers didChangeActivePlayback") {
                    it("triggers enable dvr with false") {
                        let plugin = buildPlugin(position: 10, playbackType: .vod)
                        var didHaveDvr = true
                        plugin.core?.activePlayback?.on("enableDVR") { (userInfo: EventUserInfo) in
                            didHaveDvr = (userInfo?["enabled"] as? Bool) ?? false
                        }
                        
                        plugin.core?.trigger(InternalEvent.didChangeActiveContainer.rawValue)
                        
                        expect(didHaveDvr).toEventually(beFalse())
                    }
                }
            }
            
            func buildPlugin(position seconds: Double, playbackType: PlaybackType) -> DVRPlugin {
                core = Core()
                container = Container()
                core.activeContainer = container
                
                let playback = AVFoundationPlaybackStub()
                let player = AVPlayerStub()
                player.set(currentTime: CMTime(seconds: seconds, preferredTimescale: 1))
                playback.player = player
                playback.set(playbackType: playbackType)
                core.activeContainer?.playback = playback
                
                return DVRPlugin(context: core)
            }
        }
    }
