 CineIO = require('../src/main')
+PlayStream = require('../src/play_stream')
+PublishStream = require('../src/publish_stream')
+ApiBridge = require('../src/api_bridge')
 
 describe 'CineIO', ->
 

      it 'requires a DOM Node', ->
        fn = -> CineIO.publish("FAKE_STREAM_ID", "FAKE_PASSWORD")
        expect(fn).to.throw(Error, "DOM node required.")

  describe '.play', ->
    requiresInit('play')

      it 'requires a DOM Node', ->
        fn = -> CineIO.play("FAKE_STREAM_ID")
        expect(fn).to.throw(Error, "DOM node required.")

      describe 'success', ->
        beforeEach ->
          @playStub = sinon.stub PlayStream, 'live'

        afterEach ->
          @playStub.restore()

        it 'calls to PlayStream', ->
          CineIO.play("FAKE_STREAM_ID", 'fake-dom-id')
          expect(@playStub.calledOnce).to.be.true
          args = @playStub.firstCall.args
          expect(args).to.deep.equal(["FAKE_STREAM_ID", 'fake-dom-id', {}])

  describe '.playRecording', ->
    requiresInit('playRecording')
