Files
SwiftAudioEx/Example/Tests/AVPlayerItemNotificationObserverTests.swift
Jørgen Henrichsen 8b1e57b3c0 Added a Source file for test audio.
Contains the test audio file path, used in all tests.
2018-08-05 10:32:30 +02:00

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())
})
})
})
}
}
}