Sha256: 77ecd440e193836cfd4b6ec307335ceb99b02f75f73caa107bf3285e30814b3b
Contents?: true
Size: 1.12 KB
Versions: 10
Compression:
Stored size: 1.12 KB
Contents
require 'spec_helper' describe M3u8::MapItem do it 'should provide m3u8 format representation' do hash = { uri: 'frelo/prog_index.m3u8', byterange: { length: 4500, start: 600 } } item = M3u8::MapItem.new(hash) output = item.to_s expected = '#EXT-X-MAP:URI="frelo/prog_index.m3u8",' \ 'BYTERANGE="4500@600"' expect(output).to eq expected hash = { uri: 'frehi/prog_index.m3u8' } item = M3u8::MapItem.new(hash) output = item.to_s expected = '#EXT-X-MAP:URI="frehi/prog_index.m3u8"' expect(output).to eq expected end it 'should parse m3u8 text into instance' do input = '#EXT-X-MAP:URI="frelo/prog_index.m3u8",' \ 'BYTERANGE="3500@300"' item = M3u8::MapItem.parse(input) expect(item.uri).to eq 'frelo/prog_index.m3u8' expect(item.byterange.length).to eq 3500 expect(item.byterange.start).to eq 300 input = '#EXT-X-MAP:URI="frelo/prog_index.m3u8"' item = M3u8::MapItem.parse(input) expect(item.uri).to eq 'frelo/prog_index.m3u8' expect(item.byterange).to be_nil end end
Version data entries
10 entries across 10 versions & 1 rubygems