Sha256: 9c8b913b536aada35db61213bea4eb8d42c447dca4b124c329310758c217ef60

Contents?: true

Size: 1.96 KB

Versions: 2

Compression:

Stored size: 1.96 KB

Contents

require 'test_helper'

# => To do these tests you need three files, for obvious copyright reasons, Ill let you use your own!
# => You need;
# 1, 192kbps MP3(with artwork) -- 2, 320 kpbs MP3(with artwork) -- 3, 128KPBS or above MP4(with artwork)
#
#

class MpeghelperTest < Test::Unit::TestCase

    def test_mp3_192_handling

      puts "Testing MP3 192 Handling(Should do nothing)...\n"

      song = MpegHelper.mp3("1.mp3", "1.mp3", '192')

      assert true

      puts "MP3 192 Handling is fine!\n"

    end

=begin
    test "MP3 320 Handling" do

      puts "Testing MP3 320 Handling(Should transform to 192)...\n"

      FileUtils.cp "#{RAILS_ROOT}/test/fixtures/files/ahighermp3test.mp3", "#{$extracted}/ahighermp3test.mp3" 

      @mpeg = MpegHelper.mp3("ahighermp3test.mp3")

      FileUtils.remove_file "#{$music}/#{@mpeg}.mp3"

      assert true

      puts "MP3 320 Handling is fine!\n"

    end


    test "MP4 Handling" do

      puts "Testing MP4 Handling(Should make a 192 mp3)...\n"

      FileUtils.cp "#{RAILS_ROOT}/test/fixtures/files/anmp4test.m4a", "#{$extracted}/anmp4test.m4a" 

      @mpeg = MpegHelper.mp4("anmp4test.m4a")

      FileUtils.remove_file "#{$music}/#{@mpeg}.mp3"

      FileUtils.remove_file "#{$covers}/original/#{@mpeg}.jpg"
      FileUtils.remove_file "#{$covers}/medium/#{@mpeg}.jpg"
      FileUtils.remove_file "#{$covers}/small/#{@mpeg}.jpg"

      assert true

      puts "MP4 Handling is fine!\n"

    end
    
    test "MP4 With Artwork Handling" do

      puts "Testing MP4 Handling With Artwork...\n"

      FileUtils.cp "#{RAILS_ROOT}/test/fixtures/files/anmp4test.m4a", "#{$extracted}/anmp4test.m4a" 

      @mpeg = MpegHelper.mp4("anmp4test.m4a")

      FileUtils.remove_file "#{$music}/#{@mpeg}.mp3"

      FileUtils.remove_file "#{$covers}/original/#{@mpeg}.jpg"
      FileUtils.remove_file "#{$covers}/medium/#{@mpeg}.jpg"
      FileUtils.remove_file "#{$covers}/small/#{@mpeg}.jpg"

      assert true

      puts "MP4 Handling is fine!\n"

=end
    
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mpeghelper-1.3.0 test/mpeghelper_test.rb
mpeghelper-1.2.1 test/mpeghelper_test.rb