Sha256: 77c2425986f69d2a1435ddb8b55cfd6e9d0660bc718d12c635195d1f553844c1

Contents?: true

Size: 775 Bytes

Versions: 10

Compression:

Stored size: 775 Bytes

Contents

require 'spec_helper'

describe M3u8::TimeItem do
  it 'should provide m3u8 format representation' do
    options = { time: '2010-02-19T14:54:23.031' }
    item = M3u8::TimeItem.new(options)
    output = item.to_s
    expected = '#EXT-X-PROGRAM-DATE-TIME:2010-02-19T14:54:23.031'
    expect(output).to eq expected

    options = { time: Time.iso8601('2010-02-19T14:54:23.031Z') }
    item = M3u8::TimeItem.new(options)
    output = item.to_s
    expected = '#EXT-X-PROGRAM-DATE-TIME:2010-02-19T14:54:23Z'
    expect(output).to eq expected
  end

  it 'should parse m3u8 text into instance' do
    input = '#EXT-X-PROGRAM-DATE-TIME:2010-02-19T14:54:23.031Z'
    item = M3u8::TimeItem.parse(input)
    expect(item.time).to eq Time.iso8601('2010-02-19T14:54:23.031Z')
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
m3u8-0.7.0 spec/lib/m3u8/time_item_spec.rb
m3u8-0.6.9 spec/lib/m3u8/time_item_spec.rb
m3u8-0.6.8 spec/lib/m3u8/time_item_spec.rb
m3u8-0.6.7 spec/lib/m3u8/time_item_spec.rb
m3u8-0.6.6 spec/lib/m3u8/time_item_spec.rb
m3u8-0.6.5 spec/lib/m3u8/time_item_spec.rb
m3u8-0.6.4 spec/lib/m3u8/time_item_spec.rb
m3u8-0.6.3 spec/lib/m3u8/time_item_spec.rb
m3u8-0.6.2 spec/lib/m3u8/time_item_spec.rb
m3u8-0.6.1 spec/time_item_spec.rb