spec/lib/m3u8/writer_spec.rb in m3u8-0.6.6 vs spec/lib/m3u8/writer_spec.rb in m3u8-0.6.7
- old
+ new
@@ -145,9 +145,17 @@
writer = M3u8::Writer.new io
writer.write playlist
expect(io.string).to eq output
end
+ it 'should render the target duration as a decimal-integer' do
+ playlist = M3u8::Playlist.new(target: 6.2)
+ io = StringIO.open
+ writer = M3u8::Writer.new io
+ writer.write playlist
+ expect(io.string).to include('#EXT-X-TARGETDURATION:6')
+ end
+
it 'should raise error on write if item types are mixed' do
playlist = M3u8::Playlist.new
hash = { program_id: 1, width: 1920, height: 1080, codecs: 'avc',
bandwidth: 540, playlist: 'test.url' }