Sha256: 8b6322e2438e5c4f242af3f5db5b7e13e13f9c30244a8eb3e76537d6697eaa60

Contents?: true

Size: 541 Bytes

Versions: 11

Compression:

Stored size: 541 Bytes

Contents

require 'spec_helper'

describe do
  let(:test_class) { Class.new { extend M3u8 } }

  it 'should parse attributes to hash' do
    line = %(TEST-ID="Help",URI="http://test",ID=33\n)
    hash = test_class.parse_attributes line
    expect(hash['TEST-ID']).to eq 'Help'
    expect(hash['URI']).to eq 'http://test'
    expect(hash['ID']).to eq '33'
  end

  it 'should parse yes/no string' do
    value = 'YES'
    expect(test_class.parse_yes_no value).to be true
    value = 'NO'
    expect(test_class.parse_yes_no value).to be false
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
m3u8-0.6.9 spec/lib/m3u8_spec.rb
m3u8-0.6.8 spec/lib/m3u8_spec.rb
m3u8-0.6.7 spec/lib/m3u8_spec.rb
m3u8-0.6.6 spec/lib/m3u8_spec.rb
m3u8-0.6.5 spec/lib/m3u8_spec.rb
m3u8-0.6.4 spec/lib/m3u8_spec.rb
m3u8-0.6.3 spec/lib/m3u8_spec.rb
m3u8-0.6.2 spec/lib/m3u8_spec.rb
m3u8-0.6.1 spec/m3u8_spec.rb
m3u8-0.5.3 spec/m3u8_spec.rb
m3u8-0.5.2 spec/m3u8_spec.rb