Sha256: 368c4b63e4e743e975ef35fd74e3935f0ff75c16e7297eb0cfdc35b651fbf980

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

require 'spec_helper'

describe M3u8::MediaItem do
  it 'should provide m3u8 format representation' do
    hash = { type: 'AUDIO', group_id: 'audio-lo', language: 'fre',
             name: 'Francais', autoselect: true, default: false,
             uri: 'frelo/prog_index.m3u8' }
    item = M3u8::MediaItem.new(hash)
    output = item.to_s
    expected = '#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio-lo",LANGUAGE="fre",' \
               'NAME="Francais",AUTOSELECT=YES,DEFAULT=NO,' \
               'URI="frelo/prog_index.m3u8"'
    expect(output).to eq expected

    hash = { type: 'AUDIO', group_id: 'audio-lo', language: 'fre',
             assoc_language: 'spoken', name: 'Francais', autoselect: true,
             default: false, forced: true, uri: 'frelo/prog_index.m3u8' }
    item = M3u8::MediaItem.new(hash)
    output = item.to_s
    expected = '#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio-lo",LANGUAGE="fre",' \
               'ASSOC-LANGUAGE="spoken",NAME="Francais",AUTOSELECT=YES,' \
               'DEFAULT=NO,URI="frelo/prog_index.m3u8",FORCED=YES'
    expect(output).to eq expected
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
m3u8-0.5.1 spec/media_item_spec.rb
m3u8-0.5.0 spec/media_item_spec.rb