Sha256: c889253da875fa3a1ec3613187f6029f85178a8e0970cff00e15df7b528b7c23

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

require 'spec_helper'

module AirPlayer
  describe Playlist do
    subject { AirPlayer::Playlist.new }

    describe '#add' do
      context 'url' do
        before { subject.add('http://example.com/video.mp4') }
        it 'media type is url' do
          expect(subject.first.path).to match 'http'
        end
      end

      context 'Podcast RSS' do
        it do
          subject.add('http://rss.cnn.com/services/podcasting/cnnnewsroom/rss.xml')
          subject.entries do |media|
            expect(media).to be_kind_of AirPlayer::Media
          end
        end
      end

      context 'multiple files' do
        it 'have multiple files' do
          expect(subject.add('./video.mp4').size).to eq 1
          expect(subject.add('./video.m4v').size).to eq 2
        end
      end

      context 'local file' do
        it 'type is Media' do
          subject.add('../airplayer')
          subject.entries do |media|
            expect(media).to be_kind_of AirPlayer::Media
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
airplayer-0.0.8 spec/airplayer/playlist_spec.rb