8b1e57b3c0
Contains the test audio file path, used in all tests.
49 lines
1.3 KiB
Swift
49 lines
1.3 KiB
Swift
import Quick
|
|
import Nimble
|
|
import AVFoundation
|
|
|
|
@testable import SwiftAudio
|
|
|
|
|
|
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", closure: {
|
|
expect(observer.observingItem).toNot(beNil())
|
|
})
|
|
|
|
context("when ended observing", {
|
|
|
|
beforeEach {
|
|
observer.stopObservingCurrentItem()
|
|
}
|
|
|
|
it("should have no observed item", closure: {
|
|
expect(observer.observingItem).to(beNil())
|
|
})
|
|
|
|
})
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|