Sha256: 135e0c0977b142b753a725c6640b616206c5c0eb1e2d37d4cfbdbb9f7583ed2a
Contents?: true
Size: 1.21 KB
Versions: 1
Compression:
Stored size: 1.21 KB
Contents
require 'spec_helper' describe M3u8::PlaybackStart do describe '#intialize' do it 'assigns attributes' do start = described_class.new(time_offset: -12.9, precise: true) expect(start.time_offset).to eq(-12.9) expect(start.precise).to be true end end describe '#parse' do it 'parses tag with all attributes' do start = described_class.new tag = '#EXT-X-START:TIME-OFFSET=20.0,PRECISE=YES' start.parse(tag) expect(start.time_offset).to eq(20.0) expect(start.precise).to be true end it 'parses tag without optional attributes' do start = described_class.new tag = '#EXT-X-START:TIME-OFFSET=-12.9' start.parse(tag) expect(start.time_offset).to eq(-12.9) expect(start.precise).to be_nil end end describe '#to_s' do it 'returns tag with attributes' do start = described_class.new(time_offset: 9.2, precise: true) tag = start.to_s expect(tag).to eq('#EXT-X-START:TIME-OFFSET=9.2,PRECISE=YES') end it 'returns tag without optional attributes' do start = described_class.new(time_offset: 9.2) tag = start.to_s expect(tag).to eq('#EXT-X-START:TIME-OFFSET=9.2') end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
m3u8-0.7.0 | spec/lib/m3u8/playback_start_spec.rb |