Files
SwiftAudioEx/Example/Tests/AVPlayerItemNotificationObserverTests.swift
T
2021-08-12 11:40:21 +02:00

49 lines
1.3 KiB
Swift

import Quick
import Nimble
import AVFoundation
@testable import SwiftAudioEx
class AVPlayerItemNotificationObserverTests: QuickSpec {
override func spec() {
describe("A notification observer") {
var item: AVPlayerItem!
var observer: AVPlayerItemNotificationObserver!
beforeEach {
item = AVPlayerItem(url: URL(fileURLWithPath: Source.path))
observer = AVPlayerItemNotificationObserver()
}
context("when started observing") {
beforeEach {
observer.startObserving(item: item)
}
it("should have an observed item") {
expect(observer.observingItem).toNot(beNil())
}
context("when ended observing") {
beforeEach {
observer.stopObservingCurrentItem()
}
it("should have no observed item") {
expect(observer.observingItem).to(beNil())
}
}
}
}
}
}