Sha256: 4aefbc732d8aa5702bdee9c7d4b0b4637e6a6f4aa5c2e5673b1d16382b783d2b
Contents?: true
Size: 1.49 KB
Versions: 12
Compression:
Stored size: 1.49 KB
Contents
# frozen_string_literal: true # rubocop:disable Metrics/BlockLength module MovieOrganizer RSpec.describe MediaList, type: :lib do include_context 'media_shared' let(:media_list) { MediaList.new([tmpdir]) } context '#new' do %w(m4v mov mkv mp4 avi).each do |extension| it "includes #{extension} files" do create_test_file(count: 3, extension: extension) expect(media_list.file_collection.count).to eq(3) end end end context '.video?' do it 'returns true if passed filename has a video extension' do expect(media_list.video?('bogus.mp4')).to eq(true) end it "returns false if passed filename isn't a video extension" do expect(media_list.video?('bogus.mp3')).to eq(false) end end context '.subtitle?' do it 'returns true if passed filename has a subtitle extension' do expect(media_list.subtitle?('bogus.sub')).to eq(true) expect(media_list.subtitle?('bogus.srt')).to eq(true) end it "returns false if passed filename isn't a subtitle extension" do expect(media_list.subtitle?('bogus.mp3')).to eq(false) end end context '.media?' do it 'returns true if passed filename has a media extension' do expect(media_list.media?('bogus.srt')).to eq(true) expect(media_list.media?('bogus.mov')).to eq(true) expect(media_list.media?('bogus.mp3')).to eq(false) end end end end # rubocop:enable Metrics/BlockLength
Version data entries
12 entries across 12 versions & 1 rubygems