Sha256: 0bf018c53d1dafc298c8f5df062ef03d7c61f94908fd2826636645c602c38a63

Contents?: true

Size: 904 Bytes

Versions: 4

Compression:

Stored size: 904 Bytes

Contents

require_relative '../../test_helper'
describe Mp4Renamer do
  let :renamer do
    Renamer.new
  end

  let :helper do
    FixtureHelper.new
  end

  before do
    helper.setup
  end

  after do
    helper.teardown
    # remove the file that we rename also if after the steps
  end

  describe '#rename' do
    it 'renames the file if metadata is valailable' do
      helper.sample_files.each do |file|
        result = renamer.rename(file)
        # the result must be available
        assert(result)
        # cleanup after each use
        FileUtils.rm_rf result
      end
    end
  end

  describe '#rename_once?' do
    it 'returns false if not already rename' do
      refute(renamer.rename_once?('sample.mp4'))
      refute(renamer.rename_once?('sample_12_34.mp4'))
    end

    it 'returns true if already rename' do
      assert(renamer.rename_once?('sample_12_34_12_34.mp4'))
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mp4_renamer-0.1.6 test/lib/mp4_renamer/test_renamer.rb
mp4_renamer-0.1.5 test/lib/mp4_renamer/test_renamer.rb
mp4_renamer-0.1.4 test/lib/mp4_renamer/test_renamer.rb
mp4_renamer-0.1.3 test/lib/mp4_renamer/test_renamer.rb