Sha256: 538657c3bb8594c66a7edca5d6dcec3ba6ae565e886221ff73c381db70d00c0f

Contents?: true

Size: 940 Bytes

Versions: 1

Compression:

Stored size: 940 Bytes

Contents

require 'spec_helper'

describe FormatParser::M3UParser do
  let(:parsed_m3u) do
    subject.call(
      File.open(
        Pathname.new(fixtures_dir).join('M3U').join(m3u_file),
        'rb'
      )
    )
  end

  describe 'an m3u file with missing header' do
    let(:m3u_file) { 'plain_text.m3u' }

    it 'does not parse the file successfully' do
      expect(parsed_m3u).to be_nil
    end
  end

  describe 'an m3u file with valid header' do
    let(:m3u_file) { 'sample.m3u' }

    it 'parses the file successfully' do
      expect(parsed_m3u).not_to be_nil
      expect(parsed_m3u.nature).to eq(:text)
      expect(parsed_m3u.format).to eq(:m3u)
    end
  end

  describe 'an m3u8 file with valid header' do
    let(:m3u_file) { 'sample.m3u8' }

    it 'parses the file successfully' do
      expect(parsed_m3u).not_to be_nil
      expect(parsed_m3u.nature).to eq(:text)
      expect(parsed_m3u.format).to eq(:m3u)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
format_parser-0.26.0 spec/parsers/m3u_parser_spec.rb